[cairo] Re: SVG Spacewar
nigel.tao at myrealbox.com
Sun Apr 3 01:33:37 PST 2005
On Fri, 2005-04-01 at 21:21 +0800, Steve Chaplin wrote:
> You could put the gtkcairo widget inside a gtk_aspect_frame
> and then remove scale_for_aspect_ratio()
> - let gtk maintain the gtkcairo widget with the correct aspect ratio,
> and just scale to fit the widget width and height, without needing
> to use cairo_translate() to offset into the gtkcairo window, patch
I tried your patch, and it mostly works, except the resultant window is
not quite right - there's a border or something somewhere that gets in
the way. I added the two lines below, but I am not enough of a GTK guru
to know why the gtkCairo object inside the gtkAspectFrame ends up being
798 x 598 pixels rather than 800 x 600.
gtk_frame_set_shadow_type (GTK_FRAME (aframe), GTK_SHADOW_NONE);
g_object_set (G_OBJECT(aframe), "border-width", 0, NULL);
This leads to massive slow-down (my reported effective frame rate drops
from 200fps to 15fps) but I am not sure why - whether it's the non-1
scale factor or non-pixel-aligned clipping rectangle or something else.
I haven't really got around to poking too hard at it yet.
> (I'm not sure how this would interact with ']' scale-by-x1.25, and do
> not understand why you would want to define a key to do this when you
> can manually resize the window anyway)
The "[" and "]" feature is really a debugging thing. Like you
mentioned, resizing the svgspacewar window is incredibly slow, and I was
trying to see if the scaling was causing the slow-down.
More information about the cairo