mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:37:35 +00:00
LibWeb: Add initial implementation of CRC2D.clip()
This allows clipping your drawing by any path you like! To do this all painting has been wrapped around a new draw_clipped() helper method, which handles the clipping before/after painting. Note: This clipping is currently missing support for intersecting clip paths.
This commit is contained in:
parent
92d9b6edb8
commit
20e9213cc4
5 changed files with 126 additions and 102 deletions
|
@ -13,6 +13,7 @@
|
|||
#include <LibGfx/Color.h>
|
||||
#include <LibGfx/PaintStyle.h>
|
||||
#include <LibWeb/Bindings/CanvasRenderingContext2DPrototype.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasPathClipper.h>
|
||||
#include <LibWeb/HTML/CanvasGradient.h>
|
||||
#include <LibWeb/HTML/CanvasPattern.h>
|
||||
|
||||
|
@ -77,6 +78,7 @@ public:
|
|||
float line_width { 1 };
|
||||
bool image_smoothing_enabled { true };
|
||||
Bindings::ImageSmoothingQuality image_smoothing_quality { Bindings::ImageSmoothingQuality::Low };
|
||||
Optional<CanvasClip> clip;
|
||||
};
|
||||
DrawingState& drawing_state() { return m_drawing_state; }
|
||||
DrawingState const& drawing_state() const { return m_drawing_state; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue