<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p> Hello,</p>
<p>due to the scaling problems on Linux with <a
href="https://bugs.openjdk.org/browse/JDK-8326428"
class="moz-txt-link-freetext">https://bugs.openjdk.org/browse/JDK-8326428</a>,
I tried to implement a workaround by manually setting
glass.gtk.uiScale to the appropriate value. However, when this
value is not 100%, small images, in this case 40x40, often have
artifacts around the borders:<br>
</p>
<p><img src="cid:part1.JRD0e0gZ.lH1tefNR@xpipe.io" alt=""></p>
<p>Original image: <br>
</p>
<img src="cid:part2.ms4ReLGs.fnXrP1mJ@xpipe.io"
moz-do-not-send="false">
<p>The same does not happen when using the same uiScale on Windows.
This was done with the latest ea build on Ubuntu 23.10. The exact
scale does not matter as long it is not 100%.<br>
</p>
<p>This is the code I used:<br>
<br>
<code>public class ImageSize extends Application {<br>
<br>
public static void main(String[] args) {<br>
System.setProperty("glass.gtk.uiScale", "400%");<br>
Application.launch(ImageSize.class, args);<br>
}<br>
<br>
@Override<br>
public void start(Stage primaryStage) throws Exception {<br>
var img =
<a class="moz-txt-link-rfc2396E" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAEuAAABLgF7cRpNAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAACJhJREFUWIXNmHt0VNUVxn/n3nkmE/KCZDJBkCBIxRBIgqBBEKSAi2i7ZAG1tauCheUjARUp6lpW66K11CICoViLq7TlYZ9YFaGtlYfSKJiglPAQwQWBSUzIa5JJ5nlP/7hhXplMEnF1+f01c+539vnO2fvsve+FrznEV2GkcJmzCMlTwM0CPMB2TKyvWuu4fLW2r0pgcdmlEk3hCaSYG8eWW8KrQbQXjm0cevH/KrBouXOKlHIVUpT2g+4D/hjUtNWfbBr66UDXGoBAKQrLnaXAUyAmD3QhQEPIt0VQPFO1yVH91Ql8ViqFTc65IJ4BihJRjaogKCWalt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xLCzPEW1ixOZ/mvm6PSUwyaAlKZeKzC/nnsg7iF6+gmx3lgHtDjndGg6qmmoS3IweOJxQHsO+ahuV3jqYWpoZIZA79EzIsnrleBANUbHe8JycrYcYHg9EU/L+1q7+sjEQBBDV563cXn9YG4AqVk2dGNOQd6m99nc1G0zLlFSu7vW8qXgdxavTF3USJGryd4BSkubxmSPj+TDRyi0kXnA32y+mOq6JHGHBnwH0GQe/XCAKiTMlB8tGKYsy9iv/tH/WaLNSCnAglfKPrAyaAmln6yKafmKmx8ffA/40AyV2Na31IAAAAASUVORK5CYII="</a>;<br>
var r = new ImageView(img);<br>
r.setFitWidth(40);<br>
r.setFitHeight(40);<br>
<br>
var s = new StackPane(r);<br>
s.setBackground(Background.fill(Color.BLACK));<br>
<br>
var scene = new Scene(s, 100, 100);<br>
primaryStage.setScene(scene);<br>
primaryStage.setTitle("Test");<br>
primaryStage.show();<br>
}<br>
}</code></p>
<p>Is this a bug or a limitation in the renderer?</p>
<p>Best<br>
Christopher Schnick<br>
</p>
</body>
</html>