mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 22:52:10 +02:00
LibGfx+Clients: Remove Painter::LineStyle forwarding declaration
No behavior change. Follow-up to #25065.
This commit is contained in:
@@ -189,10 +189,10 @@ void ImageEditor::paint_event(GUI::PaintEvent& event)
|
||||
for (auto& guide : m_guides) {
|
||||
if (guide->orientation() == Guide::Orientation::Horizontal) {
|
||||
int y_coordinate = (int)content_to_frame_position({ 0.0f, guide->offset() }).y();
|
||||
painter.draw_line({ 0, y_coordinate }, { rect().width(), y_coordinate }, Color::Cyan, 1, Gfx::Painter::LineStyle::Dashed, Color::LightGray);
|
||||
painter.draw_line({ 0, y_coordinate }, { rect().width(), y_coordinate }, Color::Cyan, 1, Gfx::LineStyle::Dashed, Color::LightGray);
|
||||
} else if (guide->orientation() == Guide::Orientation::Vertical) {
|
||||
int x_coordinate = (int)content_to_frame_position({ guide->offset(), 0.0f }).x();
|
||||
painter.draw_line({ x_coordinate, 0 }, { x_coordinate, rect().height() }, Color::Cyan, 1, Gfx::Painter::LineStyle::Dashed, Color::LightGray);
|
||||
painter.draw_line({ x_coordinate, 0 }, { x_coordinate, rect().height() }, Color::Cyan, 1, Gfx::LineStyle::Dashed, Color::LightGray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,36 +76,36 @@ void Canvas::draw()
|
||||
painter.draw_triangle({ 430, 240 }, { 480, 140 }, { 480, 240 }, Color::Red);
|
||||
painter.draw_rect({ 380, 140, 100, 100 }, Color::Yellow);
|
||||
|
||||
painter.draw_line({ 500, 20 }, { 750, 20 }, Color::Green, 1, Gfx::Painter::LineStyle::Solid);
|
||||
painter.draw_line({ 500, 30 }, { 750, 30 }, Color::Red, 5, Gfx::Painter::LineStyle::Solid);
|
||||
painter.draw_line({ 500, 45 }, { 750, 45 }, Color::Blue, 10, Gfx::Painter::LineStyle::Solid);
|
||||
painter.draw_line({ 500, 20 }, { 750, 20 }, Color::Green, 1, Gfx::LineStyle::Solid);
|
||||
painter.draw_line({ 500, 30 }, { 750, 30 }, Color::Red, 5, Gfx::LineStyle::Solid);
|
||||
painter.draw_line({ 500, 45 }, { 750, 45 }, Color::Blue, 10, Gfx::LineStyle::Solid);
|
||||
|
||||
painter.draw_line({ 500, 60 }, { 750, 60 }, Color::Green, 1, Gfx::Painter::LineStyle::Dotted);
|
||||
painter.draw_line({ 500, 70 }, { 750, 70 }, Color::Red, 5, Gfx::Painter::LineStyle::Dotted);
|
||||
painter.draw_line({ 500, 85 }, { 750, 85 }, Color::Blue, 10, Gfx::Painter::LineStyle::Dotted);
|
||||
painter.draw_line({ 500, 60 }, { 750, 60 }, Color::Green, 1, Gfx::LineStyle::Dotted);
|
||||
painter.draw_line({ 500, 70 }, { 750, 70 }, Color::Red, 5, Gfx::LineStyle::Dotted);
|
||||
painter.draw_line({ 500, 85 }, { 750, 85 }, Color::Blue, 10, Gfx::LineStyle::Dotted);
|
||||
|
||||
painter.draw_line({ 500, 100 }, { 750, 100 }, Color::Green, 1, Gfx::Painter::LineStyle::Dashed);
|
||||
painter.draw_line({ 500, 110 }, { 750, 110 }, Color::Red, 5, Gfx::Painter::LineStyle::Dashed);
|
||||
painter.draw_line({ 500, 125 }, { 750, 125 }, Color::Blue, 10, Gfx::Painter::LineStyle::Dashed);
|
||||
painter.draw_line({ 500, 100 }, { 750, 100 }, Color::Green, 1, Gfx::LineStyle::Dashed);
|
||||
painter.draw_line({ 500, 110 }, { 750, 110 }, Color::Red, 5, Gfx::LineStyle::Dashed);
|
||||
painter.draw_line({ 500, 125 }, { 750, 125 }, Color::Blue, 10, Gfx::LineStyle::Dashed);
|
||||
|
||||
painter.draw_line({ 500, 140 }, { 500, 240 }, Color::Green, 1, Gfx::Painter::LineStyle::Solid);
|
||||
painter.draw_line({ 510, 140 }, { 510, 240 }, Color::Red, 5, Gfx::Painter::LineStyle::Solid);
|
||||
painter.draw_line({ 525, 140 }, { 525, 240 }, Color::Blue, 10, Gfx::Painter::LineStyle::Solid);
|
||||
painter.draw_line({ 500, 140 }, { 500, 240 }, Color::Green, 1, Gfx::LineStyle::Solid);
|
||||
painter.draw_line({ 510, 140 }, { 510, 240 }, Color::Red, 5, Gfx::LineStyle::Solid);
|
||||
painter.draw_line({ 525, 140 }, { 525, 240 }, Color::Blue, 10, Gfx::LineStyle::Solid);
|
||||
|
||||
painter.draw_line({ 540, 140 }, { 540, 240 }, Color::Green, 1, Gfx::Painter::LineStyle::Dotted);
|
||||
painter.draw_line({ 550, 140 }, { 550, 240 }, Color::Red, 5, Gfx::Painter::LineStyle::Dotted);
|
||||
painter.draw_line({ 565, 140 }, { 565, 240 }, Color::Blue, 10, Gfx::Painter::LineStyle::Dotted);
|
||||
painter.draw_line({ 540, 140 }, { 540, 240 }, Color::Green, 1, Gfx::LineStyle::Dotted);
|
||||
painter.draw_line({ 550, 140 }, { 550, 240 }, Color::Red, 5, Gfx::LineStyle::Dotted);
|
||||
painter.draw_line({ 565, 140 }, { 565, 240 }, Color::Blue, 10, Gfx::LineStyle::Dotted);
|
||||
|
||||
painter.draw_line({ 580, 140 }, { 580, 240 }, Color::Green, 1, Gfx::Painter::LineStyle::Dashed);
|
||||
painter.draw_line({ 590, 140 }, { 590, 240 }, Color::Red, 5, Gfx::Painter::LineStyle::Dashed);
|
||||
painter.draw_line({ 605, 140 }, { 605, 240 }, Color::Blue, 10, Gfx::Painter::LineStyle::Dashed);
|
||||
painter.draw_line({ 580, 140 }, { 580, 240 }, Color::Green, 1, Gfx::LineStyle::Dashed);
|
||||
painter.draw_line({ 590, 140 }, { 590, 240 }, Color::Red, 5, Gfx::LineStyle::Dashed);
|
||||
painter.draw_line({ 605, 140 }, { 605, 240 }, Color::Blue, 10, Gfx::LineStyle::Dashed);
|
||||
|
||||
painter.draw_line({ 640, 190 }, { 740, 240 }, Color::Green, 1, Gfx::Painter::LineStyle::Dashed);
|
||||
painter.draw_line({ 640, 140 }, { 740, 240 }, Color::Red, 5, Gfx::Painter::LineStyle::Solid);
|
||||
painter.draw_line({ 690, 140 }, { 740, 240 }, Color::Blue, 10, Gfx::Painter::LineStyle::Solid);
|
||||
painter.draw_line({ 740, 190 }, { 640, 240 }, Color::Green, 1, Gfx::Painter::LineStyle::Dotted);
|
||||
painter.draw_line({ 740, 140 }, { 640, 240 }, Color::Red, 5, Gfx::Painter::LineStyle::Solid);
|
||||
painter.draw_line({ 690, 140 }, { 640, 240 }, Color::Blue, 10, Gfx::Painter::LineStyle::Solid);
|
||||
painter.draw_line({ 640, 190 }, { 740, 240 }, Color::Green, 1, Gfx::LineStyle::Dashed);
|
||||
painter.draw_line({ 640, 140 }, { 740, 240 }, Color::Red, 5, Gfx::LineStyle::Solid);
|
||||
painter.draw_line({ 690, 140 }, { 740, 240 }, Color::Blue, 10, Gfx::LineStyle::Solid);
|
||||
painter.draw_line({ 740, 190 }, { 640, 240 }, Color::Green, 1, Gfx::LineStyle::Dotted);
|
||||
painter.draw_line({ 740, 140 }, { 640, 240 }, Color::Red, 5, Gfx::LineStyle::Solid);
|
||||
painter.draw_line({ 690, 140 }, { 640, 240 }, Color::Blue, 10, Gfx::LineStyle::Solid);
|
||||
|
||||
auto bg = Gfx::Bitmap::load_from_file("/res/html/misc/90s-bg.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
painter.draw_tiled_bitmap({ 20, 260, 480, 320 }, *bg);
|
||||
|
||||
@@ -292,7 +292,7 @@ void TabWidget::paint_event(PaintEvent& event)
|
||||
} else {
|
||||
painter.draw_line(icon_rect.top_left().moved_right(1), icon_rect.bottom_right().translated(-2), palette().button_text());
|
||||
painter.draw_line(icon_rect.top_right().moved_left(2), icon_rect.bottom_left().translated(1, -2), palette().button_text());
|
||||
painter.draw_line(icon_rect.bottom_left(), icon_rect.bottom_right().moved_left(1), palette().button_text(), 1, Painter::LineStyle::Dotted);
|
||||
painter.draw_line(icon_rect.bottom_left(), icon_rect.bottom_right().moved_left(1), palette().button_text(), 1, Gfx::LineStyle::Dotted);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -369,7 +369,7 @@ void TabWidget::paint_event(PaintEvent& event)
|
||||
} else {
|
||||
painter.draw_line(icon_rect.top_left().moved_right(1), icon_rect.bottom_right().translated(-2, -2), palette().button_text());
|
||||
painter.draw_line(icon_rect.top_right().moved_left(2), icon_rect.bottom_left().translated(1, -2), palette().button_text());
|
||||
painter.draw_line(icon_rect.bottom_left(), icon_rect.bottom_right().moved_left(1), palette().button_text(), 1, Painter::LineStyle::Dotted);
|
||||
painter.draw_line(icon_rect.bottom_left(), icon_rect.bottom_right().moved_left(1), palette().button_text(), 1, Gfx::LineStyle::Dotted);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2227,7 +2227,7 @@ void Painter::for_each_line_segment_on_cubic_bezier_curve(FloatPoint control_poi
|
||||
}
|
||||
}
|
||||
|
||||
void Painter::draw_cubic_bezier_curve(IntPoint control_point_0, IntPoint control_point_1, IntPoint p1, IntPoint p2, Color color, int thickness, Painter::LineStyle style)
|
||||
void Painter::draw_cubic_bezier_curve(IntPoint control_point_0, IntPoint control_point_1, IntPoint p1, IntPoint p2, Color color, int thickness, LineStyle style)
|
||||
{
|
||||
for_each_line_segment_on_cubic_bezier_curve(FloatPoint(control_point_0), FloatPoint(control_point_1), FloatPoint(p1), FloatPoint(p2), [&](FloatPoint fp1, FloatPoint fp2) {
|
||||
draw_line(IntPoint(fp1.x(), fp1.y()), IntPoint(fp2.x(), fp2.y()), color, thickness, style);
|
||||
|
||||
@@ -50,9 +50,6 @@ public:
|
||||
explicit Painter(Gfx::Bitmap&);
|
||||
~Painter() = default;
|
||||
|
||||
// FIXME: Remove this after replacing all uses with Gfx::LineStyle.
|
||||
using LineStyle = ::Gfx::LineStyle;
|
||||
|
||||
// FIXME: Remove this after replacing all uses with Gfx::ScalingMode.
|
||||
using ScalingMode = ::Gfx::ScalingMode;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user