DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2126
Version: 2.0-current


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.


Link: http://www.fltk.org/str.php?L2126
Version: 2.0-current

_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to