From 2ba2d603518c6d00c8de4ab00b7f39726ba5f02c Mon Sep 17 00:00:00 2001 From: Kacper Kasper Date: Tue, 18 Sep 2018 22:10:41 +0200 Subject: [PATCH] HaikuDepot: don't scale bitmaps * There was an off-by-one error in initialization code; BRect(0, 0, 15, 15) does not create 16x16 bitmap - it is 15x15. As a result vector icons were rendered at 15x15 and then scaled to 16x16. Change-Id: If1b57148e5a887a4bf71e01606d3d0d6fd0ed149 Reviewed-on: https://review.haiku-os.org/585 Reviewed-by: waddlesplash --- src/apps/haikudepot/ui/PackageListView.cpp | 2 +- src/apps/haikudepot/ui_generic/SharedBitmap.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/apps/haikudepot/ui/PackageListView.cpp b/src/apps/haikudepot/ui/PackageListView.cpp index 86f8979cb6..c75b37169f 100644 --- a/src/apps/haikudepot/ui/PackageListView.cpp +++ b/src/apps/haikudepot/ui/PackageListView.cpp @@ -332,7 +332,7 @@ PackageColumn::DrawField(BField* field, BRect rect, BView* parent) const BBitmap* bitmap = bitmapField->Bitmap(); // Scale the bitmap to 16x16 - BRect r = BRect(0, 0, 15, 15); + BRect r = BRect(0, 0, 16, 16); // figure out the placement float x = 0.0; diff --git a/src/apps/haikudepot/ui_generic/SharedBitmap.cpp b/src/apps/haikudepot/ui_generic/SharedBitmap.cpp index 6bc3f1a75d..58e69c6c2c 100644 --- a/src/apps/haikudepot/ui_generic/SharedBitmap.cpp +++ b/src/apps/haikudepot/ui_generic/SharedBitmap.cpp @@ -204,7 +204,7 @@ SharedBitmap::_CreateBitmapFromMimeType(int32 size) const if (status != B_OK) return NULL; - BBitmap* bitmap = new BBitmap(BRect(0, 0, size - 1, size - 1), 0, B_RGBA32); + BBitmap* bitmap = new BBitmap(BRect(0, 0, size, size), 0, B_RGBA32); status = bitmap->InitCheck(); if (status == B_OK) status = mimeType.GetIcon(bitmap, B_MINI_ICON); @@ -267,7 +267,7 @@ BBitmap* SharedBitmap::_LoadIconFromBuffer(const void* data, size_t dataSize, int32 size) const { - BBitmap* bitmap = new BBitmap(BRect(0, 0, size - 1, size - 1), 0, + BBitmap* bitmap = new BBitmap(BRect(0, 0, size, size), 0, B_RGBA32); status_t status = bitmap->InitCheck(); if (status == B_OK) {