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

context: provide a way to provide a distance at which to start the dash pattern #64

Closed
sbinet opened this issue Feb 18, 2019 · 2 comments

Comments

@sbinet
Copy link

sbinet commented Feb 18, 2019

see:

gg.Context.SetDash (or some other method?) should provide a way to specify an offset into the dash sequence.

gonum/plot would need it to properly implement the vg.Canvas interface, using gg as a backend for png, ... images:

sbinet added a commit to gonum/plot that referenced this issue Feb 19, 2019
This CL modifies the vgimg backend implementation to use fogleman/gg
instead of llgcode/draw2d.

This CL adds consistent handling of DPI for the fogleman/gg backend.
The old backend required to be communicated the current DPI for the
image.
This new backend does not, as the DPI is only needed for the font.
gg handles fonts via golang.org/x/image/font.Face that embeds the DPI
upon creation of that font.

The vg/vgimg.Canvas carries its own DPI information and propagates it
correctly upon font registration and creation.
This evacuates the need to communicate the current DPI to gg.

Note that the fogleman/gg backend does not have support for dash lines with
offsets and needs to be eventually implemented upstream.

Updates fogleman/gg#64.
Fixes #231.
Fixes #470.
@fogleman
Copy link
Owner

@sbinet Just added a SetDashOffset function. See if that works for you.

sbinet added a commit to sbinet-gonum/plot that referenced this issue Feb 21, 2019
sbinet added a commit to gonum/plot that referenced this issue Feb 21, 2019
@sbinet
Copy link
Author

sbinet commented Feb 21, 2019

thanks!

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

2 participants