Skip to content

Commit

Permalink
- ZWidget: Remove canvas->fillRect() call in ImageBox::OnPaint().
Browse files Browse the repository at this point in the history
* This was causing transparent images to sit on a pure black canvas rather than the colour of the dialogue box.
* This change has been submitted upstream also.
  • Loading branch information
mjr4077au committed Jan 5, 2024
1 parent a5760dc commit 6aa706c
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion libraries/ZWidget/src/widgets/imagebox/imagebox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ void ImageBox::SetImage(std::shared_ptr<Image> newImage)

void ImageBox::OnPaint(Canvas* canvas)
{
canvas->fillRect(Rect::xywh(0.0, 0.0, GetWidth(), GetHeight()), Colorf::fromRgba8(0, 0, 0));
if (image)
{
canvas->drawImage(image, Point((GetWidth() - (double)image->GetWidth()) * 0.5, (GetHeight() - (double)image->GetHeight()) * 0.5));
Expand Down

0 comments on commit 6aa706c

Please sign in to comment.