FLTK logo

STR #2126

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 2.0 | Post Text | Post File | SVN ⇄ GIT ]

STR #2126

Application:FLTK Library
Status:5 - New
Priority:4 - High, e.g. key functionality not working
Scope:3 - Applies to all machines and operating systems
Subsystem:Unassigned
Summary:Cairo: fltk::cr not affected by translation matrix
Version:2.0-current
Created By:Jasu_M
Assigned To:Unassigned
Fix Version:Unassigned
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

Post File ]

No files


Trouble Report Comments:

Post Text ]
Name/Time/Date Text  
 
#1 Jasu_M
17:11 Jan 17, 2009
In SVN, when drawing to fltk::cr in Widget::draw(), it draws to the upper-left corner of the window.

Hacks like this are currently required to fix this behaviour:
void blah::draw() {
 ...
    Rectangle abs, wnd;
    get_absolute_rect(&abs);
    window()->get_absolute_rect(&wnd);

    //Reset the global matrix, in case other draw() methods have altered it
    cairo_matrix_t matrix;
    cairo_matrix_init_identity(&matrix);
    cairo_set_matrix(cr, &matrix);

    //Translate to upper-left corner of widget from that of window
    cairo_translate(cr, abs.x() - wnd.x(), abs.y() - wnd.y());
 ...

It would be great if FLTK:s transformation matrix would be shared with Cairo, so it would behave logically.
 
     

Return to Bugs & Features | Post Text | Post File ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.