Skip to content

Commit

Permalink
vg/vgimg: handle dash offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
sbinet committed Feb 21, 2019
1 parent 85f8c72 commit 81bd881
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -2,7 +2,7 @@ module gonum.org/v1/plot

require (
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af
github.com/fogleman/gg v1.2.0
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
github.com/jung-kurt/gofpdf v1.0.0
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f
Expand Down
4 changes: 2 additions & 2 deletions go.sum
@@ -1,7 +1,7 @@
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af h1:wVe6/Ea46ZMeNkQjjBW6xcqyQA/j5e0D6GytH95g0gQ=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/fogleman/gg v1.2.0 h1:Z0uOlqo+EbPQwdbrpKV1/jEcefXGPICDtGmS/gwly30=
github.com/fogleman/gg v1.2.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90 h1:WXb3TSNmHp2vHoCroCIB1foO/yQ36swABL8aOVeDpgg=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/jung-kurt/gofpdf v1.0.0 h1:EroSdlP9BOoL5ssLYf3uLJXhCQMMM2fFxCJDKA3RhnA=
Expand Down
6 changes: 1 addition & 5 deletions vg/vgimg/vgimg.go
Expand Up @@ -195,11 +195,7 @@ func (c *Canvas) SetLineDash(ds []vg.Length, offs vg.Length) {
for i, d := range ds {
dashes[i] = d.Dots(c.DPI())
}
// FIXME(sbinet): handle offs (the distance into the dash pattern
// to start the dash.)
// this needs to be implemented on the gg side.
// see:
// - https://github.com/fogleman/gg/issues/64
c.ctx.SetDashOffset(offs.Dots(c.DPI()))
c.ctx.SetDash(dashes...)
}

Expand Down

0 comments on commit 81bd881

Please sign in to comment.