The correspinding CSSOM feautres have been added to WebSharper and will be available in the next release.

By on 4/13/2015 7:13 AM ()

... which is now public. Can you retry and report back issues, if any?

By on 4/16/2015 4:20 PM ()

Thanks; unfortunately I switched to resolving my task with HTML controls and CSS instead of Canvas. So unfortunately I won't test this in the short term. I do like the technique though, I can use it for other questions which I have. It is great that W# is so extendible!

By on 4/18/2015 11:57 AM ()

This indeed seems to be missing from our bindings. For the time being you can define an extension method or just simple method which takes a CanvasElement:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
type DOMRect = 
    { 
        [<Name "x">]      X : int
        [<Name "y">]      Y : int
        [<Name "width">]  Width : int
        [<Name "height">] Height : int
        [<Name "top">]    Top : int
        [<Name "right">]  Right : int
        [<Name "bottom">] Bottom : int 
        [<Name "left">]   Left : int
    }

type CanvasElement with
    [<Inline "$0.getBoundingClientRect()">]
    member this.GetBoundingClientRect () = X<DOMRect>

or if you don't fancy the Name attributes you can use lowercase names for the fields in DOMRect.

By on 4/7/2015 2:18 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper