fix(button): use DPR for cached pixmap scale (#6255)

This commit is contained in:
nerix
2025-06-07 13:31:58 +02:00
committed by GitHub
parent c2e0fd8efe
commit 6b627b1c5b
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -53,7 +53,7 @@
- Dev: Simplified string literals to be a re-export of Qt functions. (#6175)
- Dev: Fixed incorrect lua generation of static methods for typescript plugins. (#6190, #6223)
- Dev: Merged top/bottom and left/right notebook layouts. (#6215)
- Dev: Refactored `Button` and friends. (#6102)
- Dev: Refactored `Button` and friends. (#6102, #6255)
- Dev: `OnceFlag`'s internal flag is now atomic. (#6237)
- Dev: Bumped clang-format requirement to 19. (#6236)
+4 -2
View File
@@ -306,9 +306,11 @@ void Button::paintButton(QPainter &painter)
if (this->cachePixmap_)
{
if (this->cachedPixmap_.size() != this->size())
if (this->cachedPixmap_.size() / this->devicePixelRatio() !=
this->size())
{
this->cachedPixmap_ = QPixmap(this->size());
this->cachedPixmap_ =
QPixmap(this->size() * this->devicePixelRatio());
this->cachedPixmap_.setDevicePixelRatio(this->devicePixelRatio());
this->pixmapValid_ = false;
}