1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:37:36 +00:00

LibGfx: Re-add missing bounds-checks to Painter::draw_rect

This commit adds a draw_physical_line method, which is the exact same
as draw_line, except it's parameters are already transformed and
scaled. This is used by both draw_line and draw_rect, as a slight
optimization to save some work. It also fixed draw_rect not checking
whether it should draw the lines before drawing them.
This commit is contained in:
Matthew Olsson 2021-05-02 17:43:11 -07:00 committed by Andreas Kling
parent 8bafbdddc6
commit 4cf5514672
2 changed files with 83 additions and 40 deletions

View file

@ -154,6 +154,7 @@ protected:
void fill_rect_with_draw_op(const IntRect&, Color);
void blit_with_opacity(const IntPoint&, const Gfx::Bitmap&, const IntRect& src_rect, float opacity, bool apply_alpha = true);
void draw_physical_pixel(const IntPoint&, Color, IntSize thickness = { 1, 1 });
void draw_physical_line(IntPoint, IntPoint, Color, IntSize thickness, LineStyle style);
void fill_physical_rect(const IntRect&, Color);
ALWAYS_INLINE bool has_integer_scale() const { return float_scale().x() == float_scale().y() && float_scale().x() == floorf(float_scale().x()); }