mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:47:35 +00:00
LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSize
This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much better visual clue about what type of metric is being used.
This commit is contained in:
parent
656b01eb0f
commit
116cf92156
212 changed files with 1144 additions and 1144 deletions
|
@ -53,20 +53,20 @@ void GraphWidget::paint_event(GUI::PaintEvent& event)
|
|||
auto inner_rect = frame_inner_rect();
|
||||
float scale = (float)inner_rect.height() / (float)m_max;
|
||||
|
||||
Gfx::Point prev_point;
|
||||
Gfx::IntPoint prev_point;
|
||||
for (size_t i = 0; i < m_values.size(); ++i) {
|
||||
int x = inner_rect.right() - (i * 2) + 1;
|
||||
if (x < 0)
|
||||
break;
|
||||
float scaled_value = (float)m_values.at(m_values.size() - i - 1) * scale;
|
||||
Gfx::Point point = { x, inner_rect.bottom() - (int)scaled_value };
|
||||
Gfx::IntPoint point = { x, inner_rect.bottom() - (int)scaled_value };
|
||||
if (i != 0)
|
||||
painter.draw_line(prev_point, point, m_graph_color);
|
||||
prev_point = point;
|
||||
}
|
||||
|
||||
if (!m_values.is_empty() && text_formatter) {
|
||||
Gfx::Rect text_rect = inner_rect.shrunken(8, 8);
|
||||
Gfx::IntRect text_rect = inner_rect.shrunken(8, 8);
|
||||
text_rect.set_height(font().glyph_height());
|
||||
auto text = text_formatter(m_values.last(), m_max);
|
||||
painter.draw_text(text_rect.translated(1, 1), text.characters(), Gfx::TextAlignment::CenterRight, Color::Black);
|
||||
|
|
|
@ -37,7 +37,7 @@ class PagemapPaintingDelegate final : public GUI::TableCellPaintingDelegate {
|
|||
public:
|
||||
virtual ~PagemapPaintingDelegate() override {}
|
||||
|
||||
virtual void paint(GUI::Painter& painter, const Gfx::Rect& a_rect, const Gfx::Palette&, const GUI::Model& model, const GUI::ModelIndex& index) override
|
||||
virtual void paint(GUI::Painter& painter, const Gfx::IntRect& a_rect, const Gfx::Palette&, const GUI::Model& model, const GUI::ModelIndex& index) override
|
||||
{
|
||||
auto rect = a_rect.shrunken(2, 2);
|
||||
auto pagemap = model.data(index, GUI::Model::Role::Custom).to_string();
|
||||
|
|
|
@ -287,7 +287,7 @@ class ProgressBarPaintingDelegate final : public GUI::TableCellPaintingDelegate
|
|||
public:
|
||||
virtual ~ProgressBarPaintingDelegate() override { }
|
||||
|
||||
virtual void paint(GUI::Painter& painter, const Gfx::Rect& a_rect, const Palette& palette, const GUI::Model& model, const GUI::ModelIndex& index) override
|
||||
virtual void paint(GUI::Painter& painter, const Gfx::IntRect& a_rect, const Palette& palette, const GUI::Model& model, const GUI::ModelIndex& index) override
|
||||
{
|
||||
auto rect = a_rect.shrunken(2, 2);
|
||||
auto percentage = model.data(index, GUI::Model::Role::Custom).to_i32();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue