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

silx.gui.plot.PlotWidget: Improved line dash rendering for OpenGL backend #4015

Merged
merged 3 commits into from
Dec 19, 2023

Conversation

t20100
Copy link
Member

@t20100 t20100 commented Dec 18, 2023

This PR reworks the rendering of dashed lines in the OpenGL backend to make it more consistent with the matplotlib backend.
It aims at making dashes behaves the same as the matplotlib backend and the same between Shape and Curve.
There is a limitation due to OpenGL is that the available line width can be limited by the OpenGL implementation (this PR does not aim at mitigating that).
It also paves the way in the OpenGL backend to provide the line style as (offset, dash pattern) by centralizing the conversion of linestyle to dash pattern early.

Screen Shot 2023-12-18 at 16 05 17

related to #4010

@t20100 t20100 added this to the 2.0.0 milestone Dec 18, 2023
@t20100 t20100 requested a review from vallsv December 18, 2023 15:11
_DASH_PATTERNS = { # Convert from linestyle to dash pattern
"": None,
" ": None,
"-": (),
Copy link
Member Author

Choose a reason for hiding this comment

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

Empty tuple = solid line (no dashes). Not really nice but simple.

@t20100
Copy link
Member Author

t20100 commented Dec 19, 2023

Rebase to fix conflict

@t20100 t20100 merged commit 68051a9 into silx-kit:main Dec 19, 2023
7 checks passed
@t20100 t20100 deleted the line-dash branch December 19, 2023 12:35
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