Skip to content

Commit

Permalink
More work on scrollbutton...
Browse files Browse the repository at this point in the history
  • Loading branch information
devel-chm committed Oct 3, 2016
1 parent 257c73a commit 0e4ab81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Graphics/TriD/TriD/ScrollButtonScaler.pm
Expand Up @@ -22,12 +22,12 @@ sub new {

sub ButtonRelease{
my ($this,$x,$y) = @_;
$this->{Dist} *= $this->{Zoom};
print "ButtonRelease @_\n" if $PDL::Graphics::TriD::verbose;
}

sub ButtonPress{
my ($this,$x,$y) = @_;

print "ButtonPress @_ ",ref($this->{Win}),"\n" if $PDL::Graphics::TriD::verbose;
}

Expand Down
5 changes: 3 additions & 2 deletions Graphics/TriD/TriD/Window.pm
Expand Up @@ -71,6 +71,7 @@ sub new_viewport {
# set a default controller
use PDL::Graphics::TriD::ArcBall;
use PDL::Graphics::TriD::SimpleScaler;
use PDL::Graphics::TriD::ScrollButtonScaler;
use PDL::Graphics::TriD::Control3D;
if (defined($PDL::Graphics::TriD::offline) and $PDL::Graphics::TriD::offline==1 ) {
eval "use PDL::Graphics::TriD::VRML";
Expand All @@ -87,8 +88,8 @@ sub new_viewport {
if(ref($ev)){
$ev->set_button(0,new PDL::Graphics::TriD::ArcCone( $vp, 0, $cont->{WRotation}));
$ev->set_button(2,new PDL::Graphics::TriD::SimpleScaler( $vp, \$cont->{CDistance}));
$ev->set_button(3,new PDL::Graphics::TriD::ScrollButtonScaler();
$ev->set_button(4,new PDL::Graphics::TriD::ScrollButtonScaler();
$ev->set_button(3,new PDL::Graphics::TriD::ScrollButtonScaler( $vp, \$cont->{CDistance}, 0.9));
$ev->set_button(4,new PDL::Graphics::TriD::ScrollButtonScaler( $vp, \$cont->{CDistance}, 1.1));

$vp->eventhandler($ev);
}
Expand Down

0 comments on commit 0e4ab81

Please sign in to comment.