Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

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.