cairo_rotete() invalid on Windows
I write cairo code with FLTK on win10:
static void cairo_draw(Fl_Cairo_Window *wd, cairo_t *cr)
{
int w = wd->w(), h = wd->h();
cairo_save(cr);
{
cairo_translate(cr, w/2, h/2);
cairo_rectangle(cr, 0, 0, 70, 50); // first rectangle
cairo_set_source_rgb(cr, 0.8, 0.4, 0.6);
cairo_set_line_width(cr, 4);
cairo_stroke(cr);
}
cairo_restore(cr);
cairo_save(cr);
{
cairo_rotate(cr, M_PI / 4); // rotate 45 deg
cairo_translate(cr, w/2, h/2);
cairo_rectangle(cr, 0, 0, 70, 50); // second rectangle
cairo_set_source_rgb(cr, 1, 0, 0);
cairo_set_line_width(cr, 4);
cairo_stroke(cr);
}
cairo_restore(cr);
}
int main(int argc, char **argv)
{
Fl_Cairo_Window mw(300, 300);
mw.label("FLTK Cairo Test");
mw.box(FL_DOWN_BOX);
mw.resizable(&mw);
mw.color(FL_WHITE);
mw.set_draw_cb(cairo_draw);
mw.show(argc, argv);
return Fl::run();
}
Then, build and run is ok, but on the win10 cairo_rotate() don't work, as the follow picture:
Here, only display the first rectangle, but don't display the second is rotated rectangle, why? When I build and run on Arch linux, all thing is ok, as the follow picture:
How do i do on win10 to work the same as on linux?