Manages Locallab spot opacity according to selected one
This commit is contained in:
parent
1725a53f93
commit
0225a7f109
@ -1274,6 +1274,25 @@ void ControlSpotPanel::deleteControlSpotCurve(Gtk::TreeModel::Row row)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ControlSpotPanel::updateCurveOpacity(Gtk::TreeModel::Row selectedRow)
|
||||||
|
{
|
||||||
|
const int curveid_ = selectedRow[spots_.curveid];
|
||||||
|
|
||||||
|
// printf("updateCurveOpacity: %d\n", curveid_);
|
||||||
|
|
||||||
|
if (curveid_ == 0) { // Row has no associated curve
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int it_ = 0; it_ < (int) EditSubscriber::visibleGeometry.size(); it_++) {
|
||||||
|
if ((it_ < ((curveid_ - 1) * 7)) || (it_ > ((curveid_ - 1) * 7) + 6)) { // it_ does not belong to selected curve
|
||||||
|
EditSubscriber::visibleGeometry.at(it_)->opacity = 25.;
|
||||||
|
} else {
|
||||||
|
EditSubscriber::visibleGeometry.at(it_)->opacity = 75.;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CursorShape ControlSpotPanel::getCursor(int objectID) const
|
CursorShape ControlSpotPanel::getCursor(int objectID) const
|
||||||
{
|
{
|
||||||
// printf("Object ID: %d\n", objectID);
|
// printf("Object ID: %d\n", objectID);
|
||||||
@ -1698,6 +1717,7 @@ void ControlSpotPanel::setSelectedSpot(int id)
|
|||||||
treeview_.set_cursor(treemodel_->get_path(row));
|
treeview_.set_cursor(treemodel_->get_path(row));
|
||||||
load_ControlSpot_param();
|
load_ControlSpot_param();
|
||||||
updateParamVisibility();
|
updateParamVisibility();
|
||||||
|
updateCurveOpacity(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,6 +248,7 @@ private:
|
|||||||
void addControlSpotCurve(Gtk::TreeModel::Row row);
|
void addControlSpotCurve(Gtk::TreeModel::Row row);
|
||||||
void updateControlSpotCurve(Gtk::TreeModel::Row row);
|
void updateControlSpotCurve(Gtk::TreeModel::Row row);
|
||||||
void deleteControlSpotCurve(Gtk::TreeModel::Row row);
|
void deleteControlSpotCurve(Gtk::TreeModel::Row row);
|
||||||
|
void updateCurveOpacity(Gtk::TreeModel::Row selectedRow);
|
||||||
CursorShape getCursor(int objectID) const;
|
CursorShape getCursor(int objectID) const;
|
||||||
bool mouseOver(int modifierKey);
|
bool mouseOver(int modifierKey);
|
||||||
bool button1Pressed(int modifierKey);
|
bool button1Pressed(int modifierKey);
|
||||||
|
@ -74,7 +74,7 @@ void Circle::drawOuterGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer
|
|||||||
color = outerLineColor;
|
color = outerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb (color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
|
||||||
cr->set_line_width( getOuterLineWidth() );
|
cr->set_line_width( getOuterLineWidth() );
|
||||||
|
|
||||||
rtengine::Coord center_ = center;
|
rtengine::Coord center_ = center;
|
||||||
@ -105,7 +105,7 @@ void Circle::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer
|
|||||||
color = innerLineColor;
|
color = innerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb(color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba(color.getR(), color.getG(), color.getB(), opacity / 100.);
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_line_width( innerLineWidth );
|
cr->set_line_width( innerLineWidth );
|
||||||
@ -197,7 +197,7 @@ void Line::drawOuterGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *
|
|||||||
color = outerLineColor;
|
color = outerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb (color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.0);
|
||||||
cr->set_line_width( getOuterLineWidth() );
|
cr->set_line_width( getOuterLineWidth() );
|
||||||
|
|
||||||
rtengine::Coord begin_ = begin;
|
rtengine::Coord begin_ = begin;
|
||||||
@ -232,7 +232,7 @@ void Line::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *
|
|||||||
color = innerLineColor;
|
color = innerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb (color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_line_width(innerLineWidth);
|
cr->set_line_width(innerLineWidth);
|
||||||
@ -311,7 +311,7 @@ void Polyline::drawOuterGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuff
|
|||||||
color = outerLineColor;
|
color = outerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb (color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
|
||||||
cr->set_line_width( getOuterLineWidth() );
|
cr->set_line_width( getOuterLineWidth() );
|
||||||
|
|
||||||
rtengine::Coord currPos;
|
rtengine::Coord currPos;
|
||||||
@ -355,7 +355,7 @@ void Polyline::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuff
|
|||||||
color = innerLineColor;
|
color = innerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb (color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_line_width( innerLineWidth );
|
cr->set_line_width( innerLineWidth );
|
||||||
@ -504,7 +504,7 @@ void Rectangle::drawOuterGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuf
|
|||||||
color = outerLineColor;
|
color = outerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb (color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
|
||||||
cr->set_line_width( getOuterLineWidth() );
|
cr->set_line_width( getOuterLineWidth() );
|
||||||
|
|
||||||
rtengine::Coord tl, br;
|
rtengine::Coord tl, br;
|
||||||
@ -548,7 +548,7 @@ void Rectangle::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuf
|
|||||||
color = innerLineColor;
|
color = innerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb (color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_line_width( innerLineWidth );
|
cr->set_line_width( innerLineWidth );
|
||||||
@ -655,7 +655,7 @@ void Ellipse::drawOuterGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuff
|
|||||||
color = outerLineColor;
|
color = outerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb (color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
|
||||||
cr->set_line_width ( getOuterLineWidth() );
|
cr->set_line_width ( getOuterLineWidth() );
|
||||||
|
|
||||||
rtengine::Coord center_ = center;
|
rtengine::Coord center_ = center;
|
||||||
@ -728,7 +728,7 @@ void Ellipse::drawInnerGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuff
|
|||||||
color = innerLineColor;
|
color = innerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb (color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_line_width ( innerLineWidth );
|
cr->set_line_width ( innerLineWidth );
|
||||||
|
@ -232,6 +232,7 @@ public:
|
|||||||
float innerLineWidth; // ...outerLineWidth = innerLineWidth+2
|
float innerLineWidth; // ...outerLineWidth = innerLineWidth+2
|
||||||
Datum datum;
|
Datum datum;
|
||||||
State state; // set by the Subscriber
|
State state; // set by the Subscriber
|
||||||
|
float opacity; // Percentage of opacity
|
||||||
|
|
||||||
Geometry ();
|
Geometry ();
|
||||||
virtual ~Geometry() {}
|
virtual ~Geometry() {}
|
||||||
@ -493,7 +494,7 @@ inline Geometry::Geometry () :
|
|||||||
innerLineColor (char (255), char (255), char (255)), outerLineColor (
|
innerLineColor (char (255), char (255), char (255)), outerLineColor (
|
||||||
char (0), char (0), char (0)), flags (
|
char (0), char (0), char (0)), flags (
|
||||||
F_VISIBLE | F_HOVERABLE | F_AUTO_COLOR), innerLineWidth (1.5f), datum (
|
F_VISIBLE | F_HOVERABLE | F_AUTO_COLOR), innerLineWidth (1.5f), datum (
|
||||||
IMAGE), state (NORMAL) {
|
IMAGE), state (NORMAL), opacity(100.) {
|
||||||
}
|
}
|
||||||
|
|
||||||
inline RGBAColor::RGBAColor () :
|
inline RGBAColor::RGBAColor () :
|
||||||
|
Loading…
x
Reference in New Issue
Block a user