Skip to content

Instantly share code, notes, and snippets.

@TahaHachana
Created April 6, 2013 09:34
Show Gist options
  • Save TahaHachana/5325555 to your computer and use it in GitHub Desktop.
Save TahaHachana/5325555 to your computer and use it in GitHub Desktop.
module LineJoin =
open IntelliFactory.WebSharper
open IntelliFactory.WebSharper.Html
open IntelliFactory.WebSharper.Html5
[<JavaScript>]
let main() =
let element = HTML5.Tags.Canvas [Text "Fallback content goes here."]
let canvas = As<CanvasElement> element.Dom
canvas.Height <- 350
canvas.Width <- 300
let context = canvas.GetContext "2d"
context.LineWidth <- 15.
// bevel
context.LineJoin <- LineJoin.Bevel
context.StrokeRect(50., 50., 200., 50.)
// miter
context.LineJoin <- LineJoin.Miter
context.StrokeRect(50., 150., 200., 50.)
// round
context.LineJoin <- LineJoin.Round
context.StrokeRect(50., 250., 200., 50.)
element
type Control() =
inherit Web.Control()
[<JavaScript>]
override __.Body = main() :> _
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment