Rev 9193 | Rev 9295 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9193 | Rev 9208 | ||
---|---|---|---|
Line 183... | Line 183... | ||
183 | 183 | ||
184 | 184 | ||
185 | PROCEDURE Triangle* (canvas: tCanvas; x1, y1, x2, y2: INTEGER; orientation: BOOLEAN); |
185 | PROCEDURE Triangle* (canvas: tCanvas; x1, y1, x2, y2: INTEGER; orientation: BOOLEAN); |
- | 186 | VAR |
|
186 | VAR |
187 | i, a, b, d: INTEGER; |
- | 188 | line: PROCEDURE (canvas: tCanvas; c, c1, c2: INTEGER); |
|
187 | i, a, b, d: INTEGER; |
189 | BEGIN |
188 | BEGIN |
190 | line := NIL; |
189 | d := ORD(orientation)*2 - 1; |
191 | d := ORD(orientation)*2 - 1; |
190 | IF y1 = y2 THEN |
192 | IF y1 = y2 THEN |
191 | i := y1; |
193 | i := y1; |
192 | a := MIN(x1, x2); |
194 | a := MIN(x1, x2); |
193 | b := MAX(x1, x2); |
- | |
194 | WHILE a <= b DO |
- | |
195 | HLine(canvas, i, a, b); |
- | |
196 | INC(i, d); |
- | |
197 | INC(a); |
- | |
198 | DEC(b) |
195 | b := MAX(x1, x2); |
199 | END |
196 | line := HLine |
200 | ELSIF x1 = x2 THEN |
197 | ELSIF x1 = x2 THEN |
201 | i := x1; |
198 | i := x1; |
- | 199 | a := MIN(y1, y2); |
|
- | 200 | b := MAX(y1, y2); |
|
- | 201 | line := VLine |
|
202 | a := MIN(y1, y2); |
202 | END; |
203 | b := MAX(y1, y2); |
203 | IF line # NIL THEN |
204 | WHILE a <= b DO |
204 | WHILE a <= b DO |
205 | VLine(canvas, i, a, b); |
205 | line(canvas, i, a, b); |
206 | INC(i, d); |
206 | INC(i, d); |
207 | INC(a); |
207 | INC(a); |
208 | DEC(b) |
208 | DEC(b) |
Line 249... | Line 249... | ||
249 | 249 | ||
250 | PROCEDURE TextOut* (canvas: tCanvas; x, y: INTEGER; text: INTEGER; n: INTEGER; delimColor: INTEGER); |
250 | PROCEDURE TextOut* (canvas: tCanvas; x, y: INTEGER; text: INTEGER; n: INTEGER; delimColor: INTEGER); |
251 | CONST |
251 | CONST |
252 | WCHAR_SIZE = 2; |
252 | WCHAR_SIZE = 2; |
253 | VAR |
253 | VAR |
254 | color, i, ecx: INTEGER; |
254 | color, i, font: INTEGER; |
255 | c: WCHAR; |
255 | c: WCHAR; |
256 | BEGIN |
256 | BEGIN |
257 | IF (0 <= y) & (y <= canvas.height - canvas.font.height - 1) THEN |
257 | IF (0 <= y) & (y <= canvas.height - canvas.font.height - 1) THEN |
258 | IF x < 0 THEN |
258 | IF x < 0 THEN |
Line 266... | Line 266... | ||
266 | n := MAX(MIN(n, (canvas.width - x) DIV canvas.font.width), 0); |
266 | n := MAX(MIN(n, (canvas.width - x) DIV canvas.font.width), 0); |
267 | color := canvas.color; |
267 | color := canvas.color; |
268 | canvas.color := canvas.backColor; |
268 | canvas.color := canvas.backColor; |
269 | FillRect(canvas, x, y, x + n*canvas.font.width, y + canvas.font.height); |
269 | FillRect(canvas, x, y, x + n*canvas.font.width, y + canvas.font.height); |
270 | canvas.color := color; |
270 | canvas.color := color; |
- | 271 | font := LSL(28H + canvas.font.size, 24); |
|
271 | WHILE n > 0 DO |
272 | WHILE n > 0 DO |
272 | SYSTEM.GET(text + i*WCHAR_SIZE, c); |
273 | SYSTEM.GET(text + i*WCHAR_SIZE, c); |
273 | IF ~Lines.isSpace(c) THEN |
274 | IF ~Lines.isSpace(c) THEN |
274 | IF Languages.isDelim(c) THEN |
275 | IF Languages.isDelim(c) THEN |
275 | ecx := LSL(28H + canvas.font.size, 24) + delimColor |
276 | color := delimColor |
276 | ELSE |
277 | ELSE |
277 | ecx := LSL(28H + canvas.font.size, 24) + canvas.textColor |
278 | color := canvas.textColor |
278 | END; |
279 | END; |
279 | K.sysfunc6(4, x*65536 + y, ecx, SYSTEM.ADR(c), 1, canvas.bitmap - 8) |
280 | K.sysfunc6(4, x*65536 + y, font + color, SYSTEM.ADR(c), 1, canvas.bitmap - 8) |
280 | END; |
281 | END; |
281 | INC(x, canvas.font.width); |
282 | INC(x, canvas.font.width); |
282 | INC(i); |
283 | INC(i); |
283 | DEC(n) |
284 | DEC(n) |
284 | END |
285 | END |