-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathdomrect.go
More file actions
44 lines (33 loc) · 743 Bytes
/
domrect.go
File metadata and controls
44 lines (33 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package godom
// This file implements DOMRect interface
// https://developer.mozilla.org/en-US/docs/Web/API/DOMRect
import (
"github.com/gopherjs/gopherjs/js"
)
type DOMRect struct {
*js.Object
}
func (r *DOMRect) X() float64 {
return r.Get("x").Float()
}
func (r *DOMRect) Y() float64 {
return r.Get("y").Float()
}
func (r *DOMRect) Width() float64 {
return r.Get("width").Float()
}
func (r *DOMRect) Height() float64 {
return r.Get("height").Float()
}
func (r *DOMRect) Top() float64 {
return r.Get("top").Float()
}
func (r *DOMRect) Right() float64 {
return r.Get("right").Float()
}
func (r *DOMRect) Bottom() float64 {
return r.Get("bottom").Float()
}
func (r *DOMRect) Left() float64 {
return r.Get("left").Float()
}