Skip to content

Commit

Permalink
Merge pull request #5 from ruzhnikov/drawing_tool
Browse files Browse the repository at this point in the history
points_to_canvas_points
  • Loading branch information
ruzhnikov authored Dec 3, 2021
2 parents e49880f + b6e03fa commit cfbcc95
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2319,7 +2319,7 @@ sub get_opposite_rect {
foreach (keys %{$self->{_items}{$item}}) {

#fancy resizing using our little resize boxes
if ($rect == $self->{_items}{$item}{$_}) {
if ($rect eq $self->{_items}{$item}{$_}) {

if ($_ eq 'top-left-corner') {

Expand Down
2 changes: 1 addition & 1 deletion share/shutter/resources/modules/Shutter/Draw/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sub points_to_canvas_points {
my @points = @_;

my $num_points = scalar(@points) / 2;
my $result = GooCanvas2::CanvasPoints->new( num_points => $num_points );
my $result = GooCanvas2::CanvasPoints::new( num_points => $num_points );

for ( my $i = 0; $i < @points; $i += 2 ) {
$result->set_point( $i / 2, $points[$i], $points[ $i + 1 ] );
Expand Down
6 changes: 5 additions & 1 deletion t/Shutter/Draw/005_utils.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ use_ok("Shutter::Draw::Utils");
subtest "points_to_canvas_points" => sub {
can_ok( "Shutter::Draw::Utils", "points_to_canvas_points" );

# ..
my @points = qw/116.295135498047 146.150695800781 463.101501464844 458.543548583984/;
my $res = Shutter::Draw::Utils::points_to_canvas_points(@points);

ok( defined $res, "There's a result of points_to_canvas_points" );
isa_ok( $res, "GooCanvas2::CanvasPoints" );
};

done_testing;

0 comments on commit cfbcc95

Please sign in to comment.