Re: Goo::Canvas::Polyline acts not as expected



On Thu, 2010-04-22 at 05:39 +0000, Xi Yang wrote:
Hi everyone:

I tried to use Polyline to make a part of another complexed widget.
However, it seems the Polyline object always use its north-west of
boundingbox as its (0,0) point. For instance:

###################################

my $sz = 10;

my $coll_anchor = Goo::Canvas::Polyline->new(
        $self,
        TRUE,
        [0,$sz,$sz,0,0,-$sz,-$sz,0],
);

###################################

I expect this should draw a diamond, with its center on (0,0) point.


It works for me as expected. I don't suppose you've set these two
properties on your canvas at some point:

$canvas->set(
    'automatic-bounds'   => TRUE,
    'bounds-from-origin' => FALSE,
)

This would cause the canvas to automatically adjust to fit your drawing.
Your diamond would still be centered at (0,0), but (0,0) would no longer
be in the top-left corner of the canvas.

Jeremy






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]