Re: Gnome2::Canvas --> do I really need to worry about pixels_per_unit?
- From: walt <w41ter gmail com>
- To: gtk-perl-list gnome org
- Subject: Re: Gnome2::Canvas --> do I really need to worry about pixels_per_unit?
- Date: Tue, 24 Jun 2008 07:15:00 -0700
zentara wrote:
...
Didn't you read the code fragment I sent?
$window->set_default_size( 500, 500 );
#if scrollregion is smaller than default size, odd
# coordinate problems occur
#$canvas->set_scroll_region( 0, 0, 400, 400 ); #bad
$canvas->set_scroll_region( 0, 0, 700, 700 ); #good and works fine
Your scroll region 50,50 is less than 500,500 so a weird
coordinate transform occurs...
I understand now what my problem is. From my perspective there is no
scaling going on at all -- there is just shifting of an object left/right
or up/down on the window. The rectangle (0,0,500,500) is calibrated in
pixels and the only way to change the physical size of an object on the
screen is to change pixels_per_unit.
That's okay if you are drawing a physical object like a circle or a
triangle, but a plot of data points is not a physical object and thus
needs different units on the x and y axes. That level of abstraction
is apparently not provided by gtk+ AFAICT, but if I'm wrong please let
me know.
Thanks.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]