Ticket #1718 (assigned defect)

Opened 4 months ago

Last modified 3 weeks ago

dashed line support for Web

Reported by: michael Owned by: gabor
Priority: major Milestone: GeoGebraWebGui
Component: GeoGebraWeb Keywords:
Cc: zbynek, gabor Estimate (h): 0
Progress (%): 90

Description (last modified by arpad) (diff)

Attachments

Java.png (244.6 KB) - added by michael 4 months ago.
Firefox2.png (248.6 KB) - added by michael 4 months ago.
webkit-104795-dashed.png (377.6 KB) - added by michael 4 months ago.

Change History

comment:1 follow-up: ↓ 4 Changed 4 months ago by michael

Hopefully Chrome-Canary will support webkitLineDash soon :)
http://www.chromium.org/getting-involved/dev-channel
@Arpad: please add support for webkitLineDash in anticipation

comment:2 follow-up: ↓ 5 Changed 4 months ago by michael

Two fixes needed for mozDash:

  • "regular" lines are being drawn dashed
  • when drawing a polyline, style needs to be ROUNDED not MITRE

(see screenshots)

Changed 4 months ago by michael

Changed 4 months ago by michael

comment:3 Changed 4 months ago by michael

comment:4 in reply to: ↑ 1 Changed 4 months ago by arpad

Replying to michael:

Hopefully Chrome-Canary will support webkitLineDash soon :)
http://www.chromium.org/getting-involved/dev-channel
@Arpad: please add support for webkitLineDash in anticipation

I've done this here, although I couldn't test Canary builds on Ubuntu Linux, so I don't know if it is actually working or not (Dev build is buggy currently, Beta build is like the Stable):

http://www.geogebra.org/trac/changeset/15182/trunk/geogebra

comment:5 in reply to: ↑ 2 Changed 4 months ago by arpad

  • Progress (%) changed from 0 to 50

Replying to michael:

  • when drawing a polyline, style needs to be ROUNDED not MITRE

Second problem fixed here; now Web looks is similar to Java except inequality:

http://www.geogebra.org/trac/changeset/15184/trunk/geogebra

comment:6 Changed 4 months ago by michael

Tested in WebKit build 104795, works really well!!! Screenshot attached.

(Rendering not consistent for different line thicknesses, not our bug)

Changed 4 months ago by michael

comment:7 Changed 4 months ago by michael

  • Progress (%) changed from 50 to 90

Now we just need to wait for IE9 to implement dashed lines...

comment:8 Changed 3 months ago by arpad

As I am getting more experienced with GWT, I could find a better solution for dashed lines which also available for other canvas than the main canvas:

http://www.geogebra.org/trac/changeset/15609/trunk/geogebra

But it should be tested whether it's OK in recent canary build of Chromium/Webkit or not.

Last edited 3 months ago by arpad (previous) (diff)

comment:9 Changed 3 months ago by arpad

Later we could probably avoid the JSNI method when we use GWT's Element.getPropertyJSO and setPropertyJSO (JSO=JavaScriptObject=JsArrayNumber). But new functionality is more important than refactoring.

comment:10 Changed 3 months ago by arpad

  • Description modified (diff)
  • Milestone changed from GeoGebraWeb Alpha 3 to GeoGebraWebGui

comment:12 Changed 2 months ago by arpad

Question: do we need implementing mozDashOffset, webkitLineDashOffset? That could be included in the Stroke object in Graphics2D, however it is not set currently...

comment:14 Changed 6 weeks ago by michael

  • Owner changed from arpad to gabor
  • Status changed from new to assigned

Possible solution here:
http://davidowens.wordpress.com/2010/09/07/html-5-canvas-and-dashed-lines/

(commented out here)
https://dev.geogebra.org/trac/changeset/16666

but doesn't work for curves or filled shapes.

comment:16 Changed 3 weeks ago by michael

Dashed emulation re-enabled (for full gui only): r16994

comment:17 Changed 3 weeks ago by michael

Problem shown up by r16994 fixed:
http://dev.geogebra.org/trac/changeset/17001

Maybe there is still a problem with setClip(Shape) or AwtFactory.prototype.newRectangle(x, y, width, height)

Note: See TracTickets for help on using tickets.