Slide 21
Slide 21 text
DRAW TO THE CANVAS
v
a
r n
o
d
e = d
o
c
u
m
e
n
t
.
q
u
e
r
y
S
e
l
e
c
t
o
r
(
'
c
a
n
v
a
s
'
)
;
v
a
r c
t
x = n
o
d
e
.
g
e
t
C
o
n
t
e
x
t
(
"
2
d
"
)
;
/
/ S
e
t
u
p t
h
e d
e
f
a
u
l
t p
a
i
n
t
b
r
u
s
h a
n
d s
a
v
e
c
t
x
.
f
i
l
l
S
t
y
l
e = "
w
h
i
t
e
"
;
c
t
x
.
s
a
v
e
(
)
; /
/ R
e
s
t
o
r
e P
o
i
n
t
/
/ p
a
i
n
t b
a
c
k
g
r
o
u
n
d w
h
i
t
e
c
t
x
.
f
i
l
l
R
e
c
t
(
x
, y
, s
i
z
e
, s
i
z
e
)
;
/
/ S
e
t
u
p t
h
e c
o
l
o
u
r
e
d p
a
i
n
t
b
r
u
s
h
c
t
x
.
f
i
l
l
S
t
y
l
e = "
f
u
c
h
s
i
a
"
;
/
/ D
r
a
w P
a
t
c
h
c
t
x
.
b
e
g
i
n
P
a
t
h
(
)
;
c
t
x
.
m
o
v
e
T
o
(
x
,
y
)
;
c
t
x
.
l
i
n
e
T
o
(
x
,
y
)
;
.
.
. f
o
r a
l
l c
o
o
r
d
i
n
a
t
e
s o
f t
h
e s
h
a
p
e .
.
.
c
t
x
.
c
l
o
s
e
P
a
t
h
(
)
;
c
t
x
.
f
i
l
l
(
)
; /
/
d
r
a
w t
o s
c
r
e
e
n
c
t
x
.
r
e
s
t
o
r
e
(
)
; /
/ R
e
s
t
o
r
e b
a
c
k t
o w
h
i
t
e