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.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support