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

Lines with width 0 are not drawn #18

Open
vadz opened this issue Sep 14, 2014 · 6 comments
Open

Lines with width 0 are not drawn #18

vadz opened this issue Sep 14, 2014 · 6 comments

Comments

@vadz
Copy link
Collaborator

vadz commented Sep 14, 2014

The lines screen in the drawing samples shows that the lines with 0 width are not drawn at all.

@alexpana
Copy link
Owner

This is intentional. If the width is 0, why should there be a line drawn? It is also the implicit behavior of Direct2D.

@vadz
Copy link
Collaborator Author

vadz commented Sep 18, 2014

Width 0 means "use physical pen" for GDI, i.e. it always draws a line one pixel wide independently of the current scaling etc. If this is too difficult to implement with D2D, it should at least be the same as using width 1.

@alexpana
Copy link
Owner

Thanks for the explanation. Is this behavior consistent across platforms? In any case, I'll have a look at how to achieve the same effect in Direct2D.

@csomor
Copy link
Collaborator

csomor commented Sep 18, 2014

yes, actually in graphics.cpp on OSX I fix it at 0.1 pt:
wxMacCoreGraphicsPenData::wxMacCoreGraphicsPenData( wxGraphicsRenderer* renderer, const wxPen& pen) I do
m_width = pen.GetWidth();
if (m_width <= 0.0)
m_width = (CGFloat) 0.1;

@alexpana
Copy link
Owner

But is that independent of scaling? If I use x20 scaling (x & y), wouldn't it draw a 2 pixel width line?

@csomor
Copy link
Collaborator

csomor commented Sep 18, 2014

actually that's what I inteded, to have a 'fine line' the convention for dc was a pen with width 0,eg like in a technical drawing, so if things are scaled 20x having a 2pt is fine IMHO

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

No branches or pull requests

3 participants