Skip to content

Commit 4d48c48

Browse files
committed
Add plot bar labels
1 parent 4198b23 commit 4d48c48

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/OpenCVGUI/OGUIPlotArea.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -615,12 +615,12 @@ namespace OpenCVGUI {
615615
NVGcolor color= nvgRGBA(color_scheme.at(c), color_scheme.at(c+1), color_scheme.at(c+2), 255);
616616
// Dots
617617
for (int i = 0; i < data.cols; i++) {
618-
float dot_x=start_x + i * dx;
618+
float dot_x=start_x + i * dx + bar_width * p;
619619
float dot_y=start_y - dy * ((data.at<float>(p,i)) / m);
620620
// Draw hover label
621621
if(isMouseIn()) {
622-
if( dot_y-4<= window->mouse_y && window->mouse_y <= dot_y+4 &&
623-
dot_x-4<= window->mouse_x && window->mouse_x <= dot_x+4 ){
622+
if( dot_y<= window->mouse_y && window->mouse_y <= start_y &&
623+
dot_x<= window->mouse_x && window->mouse_x <= dot_x+bar_width ){
624624

625625
// Calculate text width for box
626626
nvgFontSize(vg, 16.0f);

0 commit comments

Comments
 (0)