Crashes while switching in preview through layers with arrow keys

Also added a check box to visualize a single layer only
in the 3D path view. The check box may be toggled with a 'S' key.

Added shift+U / shift+D buttons in the 3D path view to show a single
layer only.
This commit is contained in:
bubnikv 2016-11-08 17:13:16 +01:00
parent e92501e51e
commit e15b5f4587
2 changed files with 76 additions and 44 deletions

View file

@ -53,17 +53,17 @@ sub new {
EVT_KEY_DOWN($canvas, sub {
my ($s, $event) = @_;
my $key = $event->GetKeyCode;
if ($key == 85 || $key == WXK_LEFT) {
if ($key == ord('D') || $key == WXK_LEFT) {
# Keys: 'D' or WXK_LEFT
$slider->SetValue($slider->GetValue + 1);
$self->set_z($self->{layers_z}[$slider->GetValue]);
} elsif ($key == 68 || $key == WXK_RIGHT) {
# Keys: 'U' or WXK_RIGHT
$slider->SetValue($slider->GetValue - 1);
$self->set_z($self->{layers_z}[$slider->GetValue]);
} elsif ($key >= 49 && $key <= 55) {
} elsif ($key == ord('U') || $key == WXK_RIGHT) {
# Keys: 'U' or WXK_RIGHT
$slider->SetValue($slider->GetValue + 1);
$self->set_z($self->{layers_z}[$slider->GetValue]);
} elsif ($key >= ord('1') && $key <= ord('3')) {
# Keys: '1' to '3'
$canvas->set_simulation_mode($key - 49);
$canvas->set_simulation_mode($key - ord('1'));
}
});