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

Add a white outline on the rubberband so it's better visible in various backgrounds #4762

Merged
merged 7 commits into from
Nov 20, 2023

Conversation

suricactus
Copy link
Collaborator

before after
image image

@qfield-fairy
Copy link
Collaborator

qfield-fairy commented Nov 14, 2023

sgGeom->setDrawingMode( QSGGeometry::DrawLineStrip );
node->setGeometry( sgGeom );
node->setMaterial( &mMaterial );
node->setFlag( QSGNode::OwnsGeometry );
node->setFlag( QSGNode::OwnedByParent );
return node;

outlineSGGeom->setLineWidth( static_cast<float>( mWidth * 3 ) );
Copy link
Member

Choose a reason for hiding this comment

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

I think here I'd go for mWidth + 4 (to ever only add a 2 pixel buffer outside of the main width), I think the outline shouldn't grow in width alongside the main width.

Copy link
Member

Choose a reason for hiding this comment

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

Actually sorry, we'll need to send the outline width separately from the rubber band class as we need the device pixel ratio to have a static outline buffer width.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's nice when the first comment raises a question and the second one answers it. :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Initially did it like you said with extra parameter, then I thought it might not be needed to make the API slightly simpler and only add it on demand. Well, the demand came :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image
@nirvn pushed the requested version

@m-kuhn
Copy link
Member

m-kuhn commented Nov 15, 2023

Nice! Could you show a screenshot of a line on a forest orthophoto?

@nirvn
Copy link
Member

nirvn commented Nov 16, 2023

@suricactus , nice, thanks

@m-kuhn , this is 70% towards the aimed goal, we still need coordinate cursor tweaks to match the screenshot

@nirvn
Copy link
Member

nirvn commented Nov 16, 2023

@suricactus , good looks good. Seems like your build environment hasn't been hooked to the pre-commit stuff yet :)

@suricactus
Copy link
Collaborator Author

Recording 2023-11-19 at 04 17 51

IMO @nirvn this look ok on various backgrounds.

@nirvn
Copy link
Member

nirvn commented Nov 19, 2023

@suricactus , sweet!

@suricactus suricactus merged commit ec02062 into master Nov 20, 2023
19 checks passed
@suricactus suricactus deleted the contrasted_rubberband branch November 20, 2023 10:14
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.

4 participants