Skip to content

Commit

Permalink
Add plot bar labels
Browse files Browse the repository at this point in the history
  • Loading branch information
damiles committed Jun 8, 2017
1 parent 4198b23 commit 4d48c48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/OpenCVGUI/OGUIPlotArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,12 +615,12 @@ namespace OpenCVGUI {
NVGcolor color= nvgRGBA(color_scheme.at(c), color_scheme.at(c+1), color_scheme.at(c+2), 255);
// Dots
for (int i = 0; i < data.cols; i++) {
float dot_x=start_x + i * dx;
float dot_x=start_x + i * dx + bar_width * p;
float dot_y=start_y - dy * ((data.at<float>(p,i)) / m);
// Draw hover label
if(isMouseIn()) {
if( dot_y-4<= window->mouse_y && window->mouse_y <= dot_y+4 &&
dot_x-4<= window->mouse_x && window->mouse_x <= dot_x+4 ){
if( dot_y<= window->mouse_y && window->mouse_y <= start_y &&
dot_x<= window->mouse_x && window->mouse_x <= dot_x+bar_width ){

// Calculate text width for box
nvgFontSize(vg, 16.0f);
Expand Down

0 comments on commit 4d48c48

Please sign in to comment.