Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Pixel perfect with scaling
QtWS25 Last Chance

Pixel perfect with scaling

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Flamaros
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vmatikainen
      wrote on last edited by
      #2

      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?

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved