Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added mouse wheel support c++ and python. (fixed image draw when size mismatch, fixed enhanced window image out of window) #97

Closed
wants to merge 7 commits into from

Conversation

mwindowshz
Copy link

added mouse wheel support.
but opening the commented theFlags int
void handleMouse(int theEvent, int theX, int theY, int theFlags, void* theData)
function.

how this update is good. tested this on windows. (cpp and python)
and in linux the python version. that mouse wheel event up and down was recorded.

in Enhanced window
there was a bug, EnhancedWindow draws image outside of window issue #95
EnhancedWindow draws image outside of window
added my fix commented line 74

//cvui::beginRow(frame, mX + std::lround(10*mFontScale/cvui::DEFAULT_FONT_SCALE), mY + std::lround(30*mFontScale/cvui::DEFAULT_FONT_SCALE), mWidth - scaledTitleHeight, mHeight - scaledTitleHeight);

Bug cvui:image() crash when size of image is larger from canvas issue #94
added if statment to solve the issue:

void image(cvui_block_t& theBlock, cv::Rect& theRect, cv::Mat& theImage) {
		if (theRect.x < 0 || theRect.y <0 ||theRect.x + theRect.width > theBlock.where.cols || theRect.y  + theRect.height > theBlock.where.rows)
			return;
		theImage.copyTo(theBlock.where(theRect));
	}

Please test my changes,
Hope these changes can be incorporated in your repository, and pip install versions of cvui

Thanks for your great work
M.

@Dovyski
Copy link
Owner

Dovyski commented Aug 21, 2020

That's an awesome contribution, thank you very much!

@mwindowshz
Copy link
Author

fixed compile problem. when opencv version is 2.4
added support for mouse double click

@mwindowshz mwindowshz closed this Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants