Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.15.5
-
fd23a222e (dev)
Description
Anchoring a rectangle to the verticalCenter of parent rectangle when both use real values for height / y seems to result in a miscalculation in the position.
import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.15 Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Rectangle { id:rect2 width: 100 height : 41.2 color: "light blue" Rectangle { id:line2 anchors.verticalCenter: parent.verticalCenter anchors.alignWhenCentered: false width: 100 height: 0.9 color: "black" onYChanged: console.log("Y, HEIGHT:", y, height) } } }
The output would be: qml: Y, HEIGHT: 20.650000000000002 0.9.
Steps to reproduce the problem:
- Run the attached project
Attachments
Issue Links
- duplicates
-
QTBUG-57594 Items positions are not aligned to whole pixel
- Reported
- relates to
-
QTBUG-111814 Dpi Scaling affect line width.
- Reported