Fixes related to Face Rotation (#4437)

* Adjust size of icon to match others

* Make the rotate button disabled if a face is not selected

* Fix color issue
This commit is contained in:
Benjamin Landers 2018-06-04 18:29:15 -07:00 committed by Joseph Lenox
parent 9856947d45
commit ff3234d8f0
3 changed files with 4 additions and 0 deletions

View File

@ -1112,6 +1112,7 @@ sub draw_volumes {
$min_offset //= 0;
$max_offset //= $volume->qverts->size;
glColor4f(@baseColor);
glVertexPointer_c(3, GL_FLOAT, 0, $volume->qverts->verts_ptr);
glNormalPointer_c(GL_FLOAT, 0, $volume->qverts->norms_ptr);
glDrawArrays(GL_QUADS, $min_offset / 3, ($max_offset-$min_offset) / 3);

View File

@ -54,6 +54,7 @@ sub new {
$self->{btn_rot} = Wx::Button->new($self, -1, "Rotate to Plane", wxDefaultPosition, wxDefaultSize);
$self->{btn_rot}->SetDefault;
$self->{btn_rot}->Disable;
$button_sizer->Add($self->{btn_rot}, 0, wxALIGN_RIGHT | wxALL, 10);
$optgroup->append_line(Slic3r::GUI::OptionsGroup::Line->new(
sizer => $button_sizer,
@ -77,7 +78,9 @@ sub new {
$canvas->zoom_to_volumes;
$canvas->on_select(sub {
my ($volume_idx) = @_;
$self->{btn_rot}->Disable;
$self->{normal} = $canvas->calculate_normal($volume_idx);
$self->{btn_rot}->Enable if defined $self->{normal};
});
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 643 B

After

Width:  |  Height:  |  Size: 478 B