Skip to content

Commit

Permalink
draw overlays with XOR logicOp, change menu text
Browse files Browse the repository at this point in the history
Signed-off-by: tkchanat <[email protected]>
  • Loading branch information
tkchanat committed Sep 28, 2024
1 parent 35a5b0d commit e708a04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/iv/imageviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,16 +386,15 @@ ImageViewer::createActions()
// toggleImageAct->setEnabled(true);
connect(toggleImageAct, SIGNAL(triggered()), this, SLOT(toggleImage()));

showDataWindowAct = new QAction(tr("Show Data Window"), this);
showDataWindowAct = new QAction(tr("Show Data Window (solid line)"), this);
showDataWindowAct->setCheckable(true);
connect(showDataWindowAct, SIGNAL(triggered()), this,
SLOT(toggleDataWindow()));

showDisplayWindowAct = new QAction(tr("Show Display Window"), this);
showDisplayWindowAct = new QAction(tr("Show Display Window (dotted line)"), this);
showDisplayWindowAct->setCheckable(true);
connect(showDisplayWindowAct, SIGNAL(triggered()), this,
SLOT(toggleDisplayWindow()));
showDisplayWindowAct->setChecked(true); // Show display window by default

slideShowAct = new QAction(tr("Start Slide Show"), this);
connect(slideShowAct, SIGNAL(triggered()), this, SLOT(slideShow()));
Expand Down
10 changes: 8 additions & 2 deletions src/iv/ivgl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -946,12 +946,15 @@ IvGL::paint_datawindow()
glDisable(GL_TEXTURE_2D);
glUseProgram(0);

glColor4f(0.5f, 0.5f, 0.5f, 1.f);
const float xmin = spec.x;
const float xmax = spec.x + spec.width;
const float ymin = spec.y;
const float ymax = spec.y + spec.height;
glPushAttrib(GL_ENABLE_BIT);
glEnable(GL_COLOR_LOGIC_OP);
glLogicOp(GL_XOR);
gl_rect_border(xmin, ymin, xmax, ymax);
glPopAttrib();
}


Expand All @@ -965,12 +968,15 @@ IvGL::paint_displaywindow()
glDisable(GL_TEXTURE_2D);
glUseProgram(0);

glColor4f(0.5f, 0.5f, 0.5f, 1.f);
const float xmin = spec.full_x;
const float xmax = spec.full_x + spec.full_width;
const float ymin = spec.full_y;
const float ymax = spec.full_y + spec.full_height;
glPushAttrib(GL_ENABLE_BIT);
glEnable(GL_COLOR_LOGIC_OP);
glLogicOp(GL_XOR);
gl_rect_dotted_border(xmin, ymin, xmax, ymax);
glPopAttrib();
}


Expand Down

0 comments on commit e708a04

Please sign in to comment.