Results 1 to 4 of 4

Thread: Why QPainter::rotate doesn't affect QPainter::boundingRect?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Why QPainter::rotate doesn't affect QPainter::boundingRect?

    Because when you rotate or translate the painter you change only the coordinate system it uses.

    Suppose you have a class that receives a QPainter instance and draws some text on it (like QTextDocumentLayout or Q3CanvasItem). When you rotate the painter, everything that class paints will be rotated, but it doesn't have to know that you have rotated the painter --- it just draws using the current coordinate system.

    Now if QPainter::boundingRect() would return a different rectangle depending on how much you have rotated the painter, it would brake everything --- suddenly the mentioned class would start drawing things differently if the painter was rotated and you wouldn't like that.

  2. The following user says thank you to jacek for this useful post:

    SkripT (30th April 2006)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.