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 Zooming to Mouse-Position #74

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

BestVanRome
Copy link

Hi @abreheret,
for my purpuses I added a zooming function to your project.

I used it to annotate large pictures, where a fine pixel-labelling is demanded.

Hope it can serve someone else in the future.

Main Changes:
image_canvas.h (added lines: 75-78):

QSize _act_im_size             ;

private slots:
    void adjustScrollBars();

image_canvas.cpp(added lines: 104 - 141 & 187-191):

added function implementation and calling it in scaleChanged.
The calling position is important to do after the repainting.
Also added a message in the statusbar to show actual mouse position.

Questions welcome!


if(_scroll_parent->verticalScrollBar())
{
float_t posHeightRel = float_t (mPos.y()/imSize.height()); //Relation Mauspos zu Höhe des Images
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use auto instead of float_t

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what causes AppVeyor to crash.
As this is a cast to auto, which is forbidden by the visual-studio-compiler:
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-2/compiler-error-c3537?view=msvc-160

So I'm changing it back to float_t.


if(_scroll_parent->horizontalScrollBar())
{
float_t posWidthRel = float_t (mPos.x()/imSize.width()); //Relation Mauspos zu Breite des Images
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use auto instead of float_t

src/image_canvas.cpp Outdated Show resolved Hide resolved
src/image_canvas.cpp Outdated Show resolved Hide resolved
src/image_canvas.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@daandres daandres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work!

i get flickering when resizing images, but it works.
see inline comments for requested changes.

@BestVanRome
Copy link
Author

Ok, so shall I do another commit and do another pull-request or what would be the appropriate next steps for me to finish the pull-request?

@daandres
Copy link
Contributor

I'm not code owner.
but I would suggest to add a new commit in this pull request.

src/image_canvas.cpp Outdated Show resolved Hide resolved
src/image_canvas.cpp Show resolved Hide resolved
@abreheret
Copy link
Owner

I will take a closer look as soon as I have time. there are already some updates going on on the dev branch that i need to merge, that said your code does not compile under windows in current state (https://ci.appveyor.com/project/abreheret/pixelannotationtool/builds/38772849#L96).

@BestVanRome
Copy link
Author

I don't have a windows environment.
I can build and run it smoothly on my Ubuntu 20.04.
What's the issue now?
Can I look into appveyor on my own?

@BestVanRome
Copy link
Author

Hi @abreheret,
any news?
Shall I update smth?

Changed the auto -> float_t again as it caused crash on visual-studio-compiler: C3537 (cast to auto is forbidden)
@BestVanRome
Copy link
Author

Ou dammit :-/. What's the matter 😆 now?!

BestVanRome and others added 5 commits July 19, 2021 19:10
@arbasli2
Copy link

Hi guys, any news regarding merging this feature to master?

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.

None yet

4 participants