mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
renderer/canvas: Check refresh before draw
If target() is called again after update() is called and the size of the buffer changes, a crash may occur. Therefore, check the refresh variable and perform drawing after update().
This commit is contained in:
parent
b71d9d563a
commit
60212747b5
1 changed files with 1 additions and 0 deletions
|
@ -114,6 +114,7 @@ struct Canvas::Impl
|
|||
|
||||
Result draw()
|
||||
{
|
||||
if (refresh) update(nullptr, false);
|
||||
if (status == Status::Drawing || paints.empty() || !renderer->preRender()) return Result::InsufficientCondition;
|
||||
|
||||
bool rendered = false;
|
||||
|
|
Loading…
Add table
Reference in a new issue