Ignore:
Timestamp:
Oct 28, 2009, 10:10:28 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: QPixmap: Don't scale small pixmaps to fit the system icon size when creating icons (e.g. 16x16 -> 20x20) but instead center them in a system sized rectangle to avoid ugly distortions happening when scaling such small images.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/image/qpixmap_pm.cpp

    r262 r264  
    4747#include "qicon.h"
    4848#include "qbitmap.h"
     49
    4950
    5051#include "qt_os2.h"
     
    230231        return NULLHANDLE;
    231232
     233
    232234    int w = WinQuerySysValue(HWND_DESKTOP, isPointer ? SV_CXPOINTER : SV_CXICON);
    233235    int h = WinQuerySysValue(HWND_DESKTOP, isPointer ? SV_CYPOINTER : SV_CYICON);
     236
     237
     238
     239
    234240    QSize size = icon.actualSize(QSize(w, h));
    235     QSize sizeMini = icon.actualSize(QSize(w / 2, h / 2));
     241    QSize sizeMini = icon.actualSize(QSize(w2));
    236242
    237243    QPixmap pm = icon.pixmap(size);
     
    239245    if (pm.isNull() && pmMini.isNull())
    240246        return NULLHANDLE;
     247
     248
     249
     250
     251
     252
     253
     254
     255
     256
     257
     258
     259
     260
     261
     262
     263
     264
     265
     266
     267
     268
    241269
    242270    if (pm.isNull()) {
Note: See TracChangeset for help on using the changeset viewer.