Pixel perfect with scaling



  • Hi,

    Is there an option to force QtQuck to render GUI in pixel perfect mode after a scaling?

    We have some issues with joined items, all out items have the same scaling (applied to the root). Spaces appear between perfectly joined items, cause of incoherent computations result in transformation system.

    It act like if (pseudo code) :
    Item1 :
    x = 10
    width = 5

    Item2 (child of Item1) :
    x = Item1.x + Item1.width // Perfectly aligned based on integer value

    Resulting of scale (by 2) :
    Item1 :
    right = (x + width) / 2 = (10 + 5) / 2 = 7

    Item2 :
    left = x = Item1.x + Item1.width = 10 / 2 + 5 / 2 = 8 instead of 7

    So computations aren't coherent and spaces can be introduced between joined items.

    May I need report this as a bug?



  • Hi,

    I can not reproduce your issue. Could you elaborate little bit more. It would be perfect if you could show the exact code that shows the problem.
    @
    Item {
    x: 200
    y: 200
    width: 200
    height: 200

        scale: 2
    
        Rectangle {
            border.color: "black"
            border.width: 2
            anchors.fill: parent
        }
    
        Rectangle {
            id: item1
            x: 10
            width: 5
            height: 100
            color: "red"
    
            Rectangle {
                x: /*item1.x +*/ item1.width
    
                width: 5
                color: "green"
                height: 100
            }
        }
    
    }
    

    @

    This didn't show any gaps. Do you have rotations on your items and/or are they Images?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.