<HTML
><HEAD
><TITLE
>Coordinates</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.44"><LINK
REL="HOME"
TITLE="Gnome Developers' Information"
HREF="book1.html"><LINK
REL="UP"
TITLE="The GnomeCanvas widget"
HREF="gnome-canvas.html"><LINK
REL="PREVIOUS"
TITLE="Organization of items"
HREF="gnome-canvas-organization-of-items.html"><LINK
REL="NEXT"
TITLE="Attributes and object arguments"
HREF="gnome-canvas-object-arguments.html"></HEAD
><BODY
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Gnome Developers' Information</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="gnome-canvas-organization-of-items.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 8. The <SPAN
CLASS="TYPE"
>GnomeCanvas</SPAN
> widget</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="gnome-canvas-object-arguments.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="GNOME-CANVAS-COORDINATES"
>Coordinates</A
></H1
><P
>	The canvas uses a world coordinate system with coordinates
	specified as floating point numbers.  World coordinates mean
	that units can represent whatever is most convenient to you:
	meters, pixels, parsecs, etc.
      </P
><P
>	Coordinates are calculated from the origin of the canvas,
	which has coordinates (0.0, 0.0).  Positive X coordinates go
	to the right of the origin, and positive Y coordinates go
	down, like in the rest of the X Window System.
      </P
><P
>	Coordinates of items are calculated with respect to their
	parent group.  When a group is moved, its children's logical
	coordinates do not change, although their physical position
	does.  A group stores a single pair of coordinates which
	define its origin relative to its parent group.  The canvas'
	root group starts with its origin in world position (0.0,
	0.0).
      </P
><P
>	For example, let us say you have a toplevel group at (5.0,
	3.0).  If you insert an item in it with coordinates (2.0,
	1.0), the item will appear to be at coordinates (7.0, 4.0).
	Coordinates of items are always relative to their parent
	group.
      </P
><P
>	You will normally only need use this floating point, world
	coordinate system.  The canvas also has a different coordinate
	system which works in terms of pixel offsets.  This coordinate
	system is used internally to control scrolling of the canvas.
	You won't need to know about it unless you want to do
	scrolling by hand (as opposed to letting scrollbars handle
	this for you), or when you create your own canvas item types.
	We will discuss this pixel coordinate system later.
      </P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="GNOME-CANVAS-ZOOMING-AND-SCALE"
>Zooming and scale</A
></H2
><P
>	  You can change the zoom factor of the canvas so that all the
	  objects in it will appear larger or smaller.  To control the
	  zoom factor, you specify the number of <I
CLASS="EMPHASIS"
>pixels per
	  unit</I
> that the canvas will use when converting
	  world coordinates to display coordinates.  The default is to
	  use 1.0 pixels per unit, so an object that is 10 units wide
	  will be displayed as 10 pixels wide.  If you set the canvas
	  to use 5 pixels per unit, then that object will be displayed
	  as 50 pixels wide.
	</P
><P
>	  Sometimes you may want some features of your drawing to have
	  the same displayed size regardless of the zoom factor of the
	  canvas.  For example, in a display of a graph composed of
	  vertices and edges, you may want the edges to keep the same
	  displayed width even if you zoom in closer to the graph, as
	  well as having arrowheads keep the same size regardless of
	  the zoom factor of the canvas.
	</P
><P
>	  Canvas items like lines and rectangles which support an
	  outline width parameter let you select whether the outline
	  width is specified in absolute pixels (which will keep the
	  same displayed size regardless of the zoom factor of the
	  canvas), or normal units (which will get scaled when the
	  zoom factor is changed).
	</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="gnome-canvas-organization-of-items.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="book1.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="gnome-canvas-object-arguments.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Organization of items</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="gnome-canvas.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Attributes and object arguments</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>