On Tue, 25 Apr 2000, James Henstridge wrote:

> I am currently working on some of the view code, and am using one canvas
> unit == one pixel, as the GnomeCanvas uses this by default.  You can
> change a view's zoom factor without too much trouble though.  (I should
> check this code in).

Well. The question is where to do the conversion from "units" to
pixels. I looked a bit at your view-code. It looks like the zoom factor
specifies the conversion from canvas units to pixels. Does this mean that
all dia-canvas-items should look at view->zoom_factor and draw in
pixel-coordinates or should the view set the correct conversion-factor
in the renderer so that items draw in canvas units?

I think letting the items draw in canvas units is best (and that is how
Dia does). This means we'll have to add support for setting the pixel/unit
conversion for pixel-based renderers and the physical/dia-unit conversion
for physically based renderers (like postscript printers). This can
probably be a implementation-dependent call (i.e. dia_gdk_renderer_set_zoom()).
 
> As far as an EPS/postscript renderer goes, you would probably want to tell
> it how much to scale by no matter what units you choose.
 
Yes.

In dia-canvas.h i saw DiaRectangle and DiaPoint. I need at least DiaPoint
in dia-renderer.h, in fact i define DiaRendererPoint there. I think maybe
we should move these to a dia-geometry.h just like in Dia, then we can add
all the little helper-functions that will be needed there. One thing
though, I had this idea that we should be able to do s/Dia/Gtk/ (or
something close to that) one day if we want to be included in Gtk+. This
means we need to be carefull about name-spaces, and GtkPoint is already in
Gtk+...I don't know if this is worth pursuing.

/ Alex




Reply via email to