2023-11-23 09:48 AM
Hi Gfx Team,
Could Drawable::getRect () in Drawable.hpp
const Rect & getRect() const
{
return rect;
}
be changed to
Rect getRect() const
{
return rect;
}
so it can be used as a parameter in e.g.
void Screen::invalidateRect ( Rect & invalidatedArea ) const
{
container.invalidateRect ( invalidatedArea );
}
With the current implementation one has to write
Screen::invalidateRect ( Rect { Drawable::getRect () } );
If not, could you add a variation e.g.
Rect getRectValue() const
{
return rect;
}
Thanks
Ferro
Solved! Go to Solution.
2024-02-06 07:50 AM
Hello @ferro ,
Thank you for the good suggestion. I think it would be easier if you use Drawable.invalidateRect() to avoid dealing with coordination conversion (for instance, from local to global).
But, anyway, you can easily copy Drawable.hpp to your project and apply changes to it. For example, you can overload the invalidateRect() like this:
void invalidateRect (const Rect& invalidatedArea) const
{
Rect r = invalidatedArea;
invalidateRect(r);
}
You can read more about apply changes to widgets here
I hope this helps you,
Best regards
2024-02-06 07:50 AM
Hello @ferro ,
Thank you for the good suggestion. I think it would be easier if you use Drawable.invalidateRect() to avoid dealing with coordination conversion (for instance, from local to global).
But, anyway, you can easily copy Drawable.hpp to your project and apply changes to it. For example, you can overload the invalidateRect() like this:
void invalidateRect (const Rect& invalidatedArea) const
{
Rect r = invalidatedArea;
invalidateRect(r);
}
You can read more about apply changes to widgets here
I hope this helps you,
Best regards