-
Notifications
You must be signed in to change notification settings - Fork 0
/
Draw.impl
31 lines (23 loc) · 869 Bytes
/
Draw.impl
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
IMPLEMENTATION Draw
-- IMPORTS {{{1
IMPORT Seq ONLY ::
Compose ONLY o
WinCanvasEditor ONLY drawing {} display text with ++
WinConfig COMPLETELY
Settings ONLY font foreground
Types ONLY line
-- GLOBAL FUNCTIONS {{{1
/*
* Draw the display.
*/
DEF draw(edit, hugeline, metr) == display(edit, lineToDrawing(hugeline))
-- LOCAL FUNCTIONS {{{1
FUN lineToDrawing : line -> drawing
DEF lineToDrawing (<>) == {}
DEF lineToDrawing (line(<>)) == {}
DEF lineToDrawing (line(w::W)) ==
lineToDrawing(line(W)) ++ (text(position(w)) with
(text (text(w)) ++
anchor (west) ++
font (font'Settings) ++
foreground(foreground'Settings)))