Commit 86e4d5cd5fb700554285b04a70c9a166e4fb32cf
1 parent
0a8d35b2
Exists in
master
and in
6 other branches
ENH: the initial colour in the colour dialog to set the colour in the clut rayca…
…sting widget is based on the selected node
Showing
1 changed file
with
5 additions
and
3 deletions
Show diff stats
invesalius/gui/widgets/clut_raycasting.py
... | ... | @@ -160,10 +160,12 @@ class CLUTRaycastingWidget(wx.Panel): |
160 | 160 | """ |
161 | 161 | point = self._has_clicked_in_a_point(evt.GetPositionTuple()) |
162 | 162 | if point: |
163 | - colour = wx.GetColourFromUser(self) | |
164 | - if colour.IsOk(): | |
163 | + i, j = point | |
164 | + actual_colour = [i * 255 for i in self.curves[i].nodes[j].colour] | |
165 | + colour_dialog = wx.GetColourFromUser(self, actual_colour) | |
166 | + if colour_dialog.IsOk(): | |
165 | 167 | i,j = point |
166 | - r, g, b = [x/255.0 for x in colour.Get()] | |
168 | + r, g, b = [x/255.0 for x in colour_dialog.Get()] | |
167 | 169 | self.colours[i][j]['red'] = r |
168 | 170 | self.colours[i][j]['green'] = g |
169 | 171 | self.colours[i][j]['blue'] = b | ... | ... |