Skip to content

Commit 13efd74

Browse files
author
jbarandiaran
committed
Add color section with right click on a pixel without manual mask color but with watershed color
1 parent 27ce3e6 commit 13efd74

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/image_canvas.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,9 @@ void ImageCanvas::mouseReleaseEvent(QMouseEvent * e) {
175175
}
176176

177177
if (e->button() == Qt::RightButton) { // selection of label
178-
QColor color = _mask.id.pixel(_mouse_pos / _scale);
179-
const LabelInfo * label = _ui->id_labels[color.red()];
178+
QColor maskColor = _mask.id.pixel(_mouse_pos / _scale);
179+
QColor watershedColor = _watershed.id.pixel(_mouse_pos / _scale);
180+
const LabelInfo * label = _ui->id_labels[maskColor.red()] != NULL? _ui->id_labels[maskColor.red()] : _ui->id_labels[watershedColor.red()];
180181
if (label != NULL)
181182
{
182183
if (!_watershed.id.isNull() && _ui->checkbox_watershed_mask->isChecked()) {

0 commit comments

Comments
 (0)