Minor change in ColorSelector to resize the previous rendered canvas

This commit is contained in:
David Capello 2022-05-16 18:35:33 -03:00
parent 922f99ef87
commit 4b99d3022a

View File

@ -117,8 +117,14 @@ public:
paint.color(bgColor);
paint.style(os::Paint::Fill);
m_canvas->drawRect(gfx::Rect(0, 0, w, h), paint);
if (oldCanvas)
m_canvas->drawSurface(oldCanvas.get(), 0, 0);
if (oldCanvas) {
m_canvas->drawSurface(
oldCanvas.get(),
gfx::Rect(0, 0, oldCanvas->width(), oldCanvas->height()),
gfx::Rect(0, 0, w, h),
os::Sampling(),
nullptr);
}
}
return m_canvas.get();
}