draw2d icon indicating copy to clipboard operation
draw2d copied to clipboard

Caps and Join style don't work for image backend

Open GoogleCodeExporter opened this issue 10 years ago • 9 comments

It appears that MiterJoin doesn't do anything at all. From reading the source 
code, if the Join style is not RoundJoin or BevelJoin, then the Joiner returned 
is the RoundJoiner. Although in my case, RoundJoin doesn't seem to work either 
(I always get a bevel).

Original issue reported on code.google.com by [email protected] on 27 Oct 2013 at 10:22

GoogleCodeExporter avatar Mar 13 '15 21:03 GoogleCodeExporter

Actually cap styles don't seem to do anything either.

Original comment by [email protected] on 27 Oct 2013 at 10:34

GoogleCodeExporter avatar Mar 13 '15 21:03 GoogleCodeExporter

I adapted the title as caps and join styles do work for the pdf backend.

stanim avatar Jul 19 '15 13:07 stanim

Is there any update on this issue?

thdxr avatar Nov 06 '15 01:11 thdxr

@llgcode What's needs to happen to fix this? I've been digging through the code to try to figure it out.

I don't quite understand why Stroke() in ftgc.go doesn't use AddStroke in the ft Rasterizer. There are a lot of abstractions going on.

fogleman avatar Feb 17 '16 20:02 fogleman

Yes you found a limitation of AddStroke Rasterizer that don't implements cubic bezier curve, so this is implemented differently in draw2d. https://github.com/golang/freetype/blob/master/raster/stroke.go#L403 I could switch to freetype stroker if it implements cubic bezier curve *and *dasher. Or you could implement it in dr'aw2d stroker here : https://github.com/llgcode/draw2d/blob/master/draw2dbase/stroker.go#L72 Thanks for your help and sorry for the delay.

-- Laurent.

On 17 February 2016 at 21:41, Michael Fogleman [email protected] wrote:

@llgcode https://github.com/llgcode What's needs to happen to fix this? I've been digging through the code to try to figure it out.

I don't quite understand why Stroke() in ftgc.go doesn't use AddStroke in the ft Rasterizer. There are a lot of abstractions going on.

— Reply to this email directly or view it on GitHub https://github.com/llgcode/draw2d/issues/27#issuecomment-185394911.

llgcode avatar Feb 19 '16 09:02 llgcode

@llgcode I ended up writing my own graphics package on top of golang/freetype/raster. It supports dashed lines and line caps / joins (and other stuff). Have a look:

https://github.com/fogleman/gg

fogleman avatar Feb 25 '16 20:02 fogleman

great!!. Seems to be a serious alternative to draw2d. You've made a great Job. Your project seems to be popular yet in 8 days ! Your implementation seems to be cleaner. Can we share/use a same interface https://github.com/llgcode/draw2d/blob/master/gc.go?

-- Laurent.

On 25 February 2016 at 21:09, Michael Fogleman [email protected] wrote:

@llgcode https://github.com/llgcode I ended up writing my own graphics package on top of golang/freetype/raster. It supports dashed lines and line caps / joins (and other stuff). Have a look:

https://github.com/fogleman/gg

— Reply to this email directly or view it on GitHub https://github.com/llgcode/draw2d/issues/27#issuecomment-188958712.

llgcode avatar Feb 26 '16 08:02 llgcode

Line cap can be drawn on every dash https://gist.github.com/llgcode/be814ce3a6df7a6f9f94

llgcode avatar Feb 29 '16 09:02 llgcode

Nice!

fogleman avatar Mar 01 '16 14:03 fogleman