1 parent 27ce3e6 commit 13efd74Copy full SHA for 13efd74
1 file changed
src/image_canvas.cpp
@@ -175,8 +175,9 @@ void ImageCanvas::mouseReleaseEvent(QMouseEvent * e) {
175
}
176
177
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()];
+ QColor maskColor = _mask.id.pixel(_mouse_pos / _scale);
+ 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()];
181
if (label != NULL)
182
{
183
if (!_watershed.id.isNull() && _ui->checkbox_watershed_mask->isChecked()) {
0 commit comments