Open whistler-1 opened 1 year ago
Hi @whistler-1, really sorry for sucha delayed reply to this ticket. Due to the nature of pixel art, scaling up by a non-whole number will necessarily cause those sorts of chunky artifacts, as you've pointed out.
I'm thinking the following might work, based somewhat on this Stackoverflow answer:
paint
method get the Window
of the Component
Window
get the scaleX
and scaleY
of the GraphicsConfiguration
.scale(Math.round(scaleX) / scaleX, Math.round(scaleY) / scaleY)
on the Graphics2D
object which should then result in the scale being rounded to the nearest integer valueI'm not at all familiar with how Windows scaling works under the hood or how it interacts with Java so I might be mistaken about the above, but it seems promising to me, and worth a try. Does it seems reasonable to you, or am I missing something obvious?
If it work, this could easily be made another configurable option, something like "force integer dispay scaling".
Description of the bug & expected behaviour When scale is set to 150% in Windows 10 sprites will scale up accordingly but in a way that messes up the spritework. Ideally sprites shouldn't be sized up in a way that makes them look "crunchy" like this, maybe only resize them at intervals of 1x, 2x, 3x etc?
You can see here that some lines become really thick and some stay 1px wide:
Environment Info
Steps to reproduce