mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-01 09:21:58 +08:00
Fix color issues
This commit is contained in:
parent
f352d433bc
commit
7362e56578
@ -7,7 +7,7 @@ class DefaultColor : public ColorScheme {
|
|||||||
public:
|
public:
|
||||||
const std::string name() const { return "Default"; }
|
const std::string name() const { return "Default"; }
|
||||||
const bool SOLID_BACKGROUNDCOLOR() const { return false; };
|
const bool SOLID_BACKGROUNDCOLOR() const { return false; };
|
||||||
const wxColour SELECTED_COLOR() const { return wxColour(0, 1, 0); };
|
const wxColour SELECTED_COLOR() const { return wxColour(0, 255, 0); };
|
||||||
const wxColour HOVER_COLOR() const { return wxColour(255*0.4, 255*0.9, 0); }; //<Hover over Model
|
const wxColour HOVER_COLOR() const { return wxColour(255*0.4, 255*0.9, 0); }; //<Hover over Model
|
||||||
const wxColour TOP_COLOR() const { return wxColour(10,98,144); }; //<TOP Backgroud color
|
const wxColour TOP_COLOR() const { return wxColour(10,98,144); }; //<TOP Backgroud color
|
||||||
const wxColour BOTTOM_COLOR() const { return wxColour(0,0,0); }; //<BOTTOM Backgroud color
|
const wxColour BOTTOM_COLOR() const { return wxColour(0,0,0); }; //<BOTTOM Backgroud color
|
||||||
@ -15,10 +15,10 @@ public:
|
|||||||
const wxColour GRID_COLOR() const { return wxColour(255*0.2, 255*0.2, 255*0.2, 255*0.4); }; //<Grid color
|
const wxColour GRID_COLOR() const { return wxColour(255*0.2, 255*0.2, 255*0.2, 255*0.4); }; //<Grid color
|
||||||
const wxColour GROUND_COLOR() const { return wxColour(255*0.8, 255*0.6, 255*0.5, 255*0.4); }; //<Ground or Plate color
|
const wxColour GROUND_COLOR() const { return wxColour(255*0.8, 255*0.6, 255*0.5, 255*0.4); }; //<Ground or Plate color
|
||||||
const wxColour COLOR_CUTPLANE() const { return wxColour(255*0.8, 255*0.8, 255*0.8, 255*0.5); };
|
const wxColour COLOR_CUTPLANE() const { return wxColour(255*0.8, 255*0.8, 255*0.8, 255*0.5); };
|
||||||
const wxColour COLOR_PARTS() const { return wxColour(1, 255*0.95, 255*0.2, 1); }; //<Perimeter color
|
const wxColour COLOR_PARTS() const { return wxColour(255, 255*0.95, 255*0.2); }; //<Perimeter color
|
||||||
const wxColour COLOR_INFILL() const { return wxColour(1, 255*0.45, 255*0.45, 1); };
|
const wxColour COLOR_INFILL() const { return wxColour(255, 255*0.45, 255*0.45); };
|
||||||
const wxColour COLOR_SUPPORT() const { return wxColour(255*0.5, 1, 255*0.5, 1); };
|
const wxColour COLOR_SUPPORT() const { return wxColour(255*0.5, 1, 255*0.5); };
|
||||||
const wxColour COLOR_UNKNOWN() const { return wxColour(255*0.5, 255*0.5, 1, 1); };
|
const wxColour COLOR_UNKNOWN() const { return wxColour(255*0.5, 255*0.5, 1); };
|
||||||
const wxColour BED_COLOR() const { return wxColour(255, 255, 255); };
|
const wxColour BED_COLOR() const { return wxColour(255, 255, 255); };
|
||||||
const wxColour BED_GRID() const { return wxColour(230, 230, 230); };
|
const wxColour BED_GRID() const { return wxColour(230, 230, 230); };
|
||||||
const wxColour BED_SELECTED() const { return wxColour(255, 166, 128); };
|
const wxColour BED_SELECTED() const { return wxColour(255, 166, 128); };
|
||||||
|
@ -46,7 +46,7 @@ void Plate3D::update(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
color_volumes();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Plate3D::color_volumes(){
|
void Plate3D::color_volumes(){
|
||||||
@ -59,8 +59,9 @@ void Plate3D::color_volumes(){
|
|||||||
if(object.selected){
|
if(object.selected){
|
||||||
rendervolume.color = ui_settings->color->SELECTED_COLOR();
|
rendervolume.color = ui_settings->color->SELECTED_COLOR();
|
||||||
}else{
|
}else{
|
||||||
rendervolume.color = wxColor(255,255,0);//ui_settings->color->COLOR_PARTS(); <- invisible because alpha is 1 (out of 255)
|
rendervolume.color = ui_settings->color->COLOR_PARTS();
|
||||||
}
|
}
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -74,7 +75,7 @@ void Plate3D::before_render(){
|
|||||||
|
|
||||||
//glDisable(GL_MULTISAMPLE) if ($self->{can_multisample});
|
//glDisable(GL_MULTISAMPLE) if ($self->{can_multisample});
|
||||||
glDisable(GL_LIGHTING);
|
glDisable(GL_LIGHTING);
|
||||||
uint i = 0;
|
uint i = 1;
|
||||||
for(Volume &volume : volumes){
|
for(Volume &volume : volumes){
|
||||||
volume.color = wxColor((i>>16)&0xFF,(i>>8)&0xFF,i&0xFF);
|
volume.color = wxColor((i>>16)&0xFF,(i>>8)&0xFF,i&0xFF);
|
||||||
i++;
|
i++;
|
||||||
@ -82,16 +83,16 @@ void Plate3D::before_render(){
|
|||||||
draw_volumes();
|
draw_volumes();
|
||||||
glFlush();
|
glFlush();
|
||||||
glFinish();
|
glFinish();
|
||||||
GLubyte color[4] = {0,0,0,0};
|
GLubyte color[4] = {0,0,0,0};
|
||||||
glReadPixels(pos.x, /*offset*/GetSize().GetHeight()- pos.y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, color);
|
glReadPixels(pos.x, GetSize().GetHeight()- pos.y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, color);
|
||||||
|
|
||||||
uint index = color[0] + (color[1]<<8) + (color[2]<<16);
|
uint index = (color[0]<<16) + (color[1]<<8) + color[2];
|
||||||
hover = false;
|
hover = false;
|
||||||
///*$self->_hover_volume_idx(undef);
|
///*$self->_hover_volume_idx(undef);
|
||||||
//$_->hover(0) for @{$self->volumes};
|
//$_->hover(0) for @{$self->volumes};
|
||||||
if (index < volumes.size()) {
|
if (index != 0 && index <= volumes.size()) {
|
||||||
hover = true;
|
hover = true;
|
||||||
hover_volume = index;
|
hover_volume = index - 1;
|
||||||
/*
|
/*
|
||||||
$self->volumes->[$volume_idx]->hover(1);
|
$self->volumes->[$volume_idx]->hover(1);
|
||||||
my $group_id = $self->volumes->[$volume_idx]->select_group_id;
|
my $group_id = $self->volumes->[$volume_idx]->select_group_id;
|
||||||
@ -105,7 +106,7 @@ void Plate3D::before_render(){
|
|||||||
glFlush();
|
glFlush();
|
||||||
glFinish();
|
glFinish();
|
||||||
glEnable(GL_LIGHTING);
|
glEnable(GL_LIGHTING);
|
||||||
color_volumes();
|
color_volumes();
|
||||||
mouse = false;
|
mouse = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user