mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 23:05:08 +00:00
LibGUI: Simplify TableCellPaintingDelegate API slightly
No need to pass the Model *and* a ModelIndex, the index knows which model it belongs to anyway.
This commit is contained in:
parent
f882424869
commit
96f98b1fc9
5 changed files with 8 additions and 8 deletions
|
@ -37,10 +37,10 @@ class PagemapPaintingDelegate final : public GUI::TableCellPaintingDelegate {
|
|||
public:
|
||||
virtual ~PagemapPaintingDelegate() override {}
|
||||
|
||||
virtual void paint(GUI::Painter& painter, const Gfx::IntRect& 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::ModelIndex& index) override
|
||||
{
|
||||
auto rect = a_rect.shrunken(2, 2);
|
||||
auto pagemap = model.data(index, GUI::ModelRole::Custom).to_string();
|
||||
auto pagemap = index.data(GUI::ModelRole::Custom).to_string();
|
||||
|
||||
float scale_factor = (float)pagemap.length() / (float)rect.width();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue