Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 2 Support (Qt 5) › canvas Transformation bug !

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #19808

    Amir

    https://qmlbook.github.io/ch07/index.html#transformation

    I’m running exact same code from the qml book and only the green rectangle is being drawn!


    import
    QtQuick 2.0

     

    Canvas {

    id: root

    width: 240; height: 120

    onPaint: {

    var ctx = getContext(“2d”)

    ctx.strokeStyle = “blue”

    ctx.lineWidth = 4

    ctx.beginPath()

    ctx.rect(-20, -20, 40, 40)

    ctx.translate(120,60)

    ctx.stroke()

    // draw path now rotated

    ctx.strokeStyle = “green”

    ctx.rotate(Math.PI/4)

    ctx.stroke()

    }

    }

     

    What am I missing here? is the code wrong or is this a bug in canvas?!

    #19809

    Alex
    Felgo Team

    Hi,

    this looks like an issue in the QML book code or a bug in canvas. It looks the same in a pure Qt application, so this is not Felgo related. You can also head over to the Qt forums and ask this question there.

    Cheers,
    Alex

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded