Prevent flickering
This commit is contained in:
parent
21364b7cd1
commit
c73378744f
3 changed files with 5 additions and 4 deletions
|
@ -25,7 +25,7 @@ sub new {
|
||||||
sub _repaint {
|
sub _repaint {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
|
|
||||||
my $dc = Wx::PaintDC->new($self);
|
my $dc = Wx::AutoBufferedPaintDC->new($self);
|
||||||
my ($cw, $ch) = $self->GetSizeWH;
|
my ($cw, $ch) = $self->GetSizeWH;
|
||||||
return if $cw == 0; # when canvas is not rendered yet, size is 0,0
|
return if $cw == 0; # when canvas is not rendered yet, size is 0,0
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ sub on_instances_moved {
|
||||||
sub repaint {
|
sub repaint {
|
||||||
my ($self, $event) = @_;
|
my ($self, $event) = @_;
|
||||||
|
|
||||||
my $dc = Wx::PaintDC->new($self);
|
my $dc = Wx::AutoBufferedPaintDC->new($self);
|
||||||
my $size = $self->GetSize;
|
my $size = $self->GetSize;
|
||||||
my @size = ($size->GetWidth, $size->GetHeight);
|
my @size = ($size->GetWidth, $size->GetHeight);
|
||||||
|
|
||||||
|
|
|
@ -730,7 +730,7 @@ sub DESTROY {
|
||||||
}
|
}
|
||||||
|
|
||||||
package Slic3r::GUI::Projector::Screen;
|
package Slic3r::GUI::Projector::Screen;
|
||||||
use Wx qw(:dialog :id :misc :sizer :colour :pen :brush :font);
|
use Wx qw(:dialog :id :misc :sizer :colour :pen :brush :font wxBG_STYLE_CUSTOM);
|
||||||
use Wx::Event qw(EVT_PAINT EVT_SIZE);
|
use Wx::Event qw(EVT_PAINT EVT_SIZE);
|
||||||
use base qw(Wx::Dialog Class::Accessor);
|
use base qw(Wx::Dialog Class::Accessor);
|
||||||
|
|
||||||
|
@ -746,6 +746,7 @@ sub new {
|
||||||
|
|
||||||
$self->config($config);
|
$self->config($config);
|
||||||
$self->config2($config2);
|
$self->config2($config2);
|
||||||
|
$self->SetBackgroundStyle(wxBG_STYLE_CUSTOM);
|
||||||
EVT_SIZE($self, \&_resize);
|
EVT_SIZE($self, \&_resize);
|
||||||
EVT_PAINT($self, \&_repaint);
|
EVT_PAINT($self, \&_repaint);
|
||||||
$self->_resize;
|
$self->_resize;
|
||||||
|
@ -807,7 +808,7 @@ sub project_layers {
|
||||||
sub _repaint {
|
sub _repaint {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
|
|
||||||
my $dc = Wx::PaintDC->new($self);
|
my $dc = Wx::AutoBufferedPaintDC->new($self);
|
||||||
my ($cw, $ch) = $self->GetSizeWH;
|
my ($cw, $ch) = $self->GetSizeWH;
|
||||||
return if $cw == 0; # when canvas is not rendered yet, size is 0,0
|
return if $cw == 0; # when canvas is not rendered yet, size is 0,0
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue