The width of a Line does not make difference when strokeWidth=1 or strokeWidth=2, but if strokeWidth=3, the difference will be very obvious.
Is it a precision problem? Below codes can be used to reproduce and the screenshot is attached
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.text.Text;
import javafx.scene.text.Font;
import javafx.scene.paint.*;
import javafx.scene.shape.*;
Stage {
title: "Application title"
scene: Scene {
width: 250
height: 100
content: [
Line {
startX: 0, startY: 49
endX: 200, endY: 49
strokeWidth: 1
stroke: Color.BLACK
}
Line {
startX: 0, startY: 59
endX: 200, endY: 59
strokeWidth: 2
stroke: Color.BLACK
}
Line {
startX: 0, startY: 69
endX: 200, endY: 69
strokeWidth: 3
stroke: Color.BLACK
}
]
}
}
Is it a precision problem? Below codes can be used to reproduce and the screenshot is attached
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.text.Text;
import javafx.scene.text.Font;
import javafx.scene.paint.*;
import javafx.scene.shape.*;
Stage {
title: "Application title"
scene: Scene {
width: 250
height: 100
content: [
Line {
startX: 0, startY: 49
endX: 200, endY: 49
strokeWidth: 1
stroke: Color.BLACK
}
Line {
startX: 0, startY: 59
endX: 200, endY: 59
strokeWidth: 2
stroke: Color.BLACK
}
Line {
startX: 0, startY: 69
endX: 200, endY: 69
strokeWidth: 3
stroke: Color.BLACK
}
]
}
}
- duplicates
-
JDK-8109925 Need doc on "Integer pixel coordinates don't match to pixels"
-
- Closed
-