@@ -647,9 +647,6 @@ proc clip*(x,y,w,h: Pint) =
647
647
clippingRect.w = min (w, screenWidth - x)
648
648
clippingRect.h = min (h, screenHeight - y)
649
649
650
- template clip * (t: (int ,int ,int ,int )) =
651
- clip (t[0 ], t[1 ], t[2 ], t[3 ])
652
-
653
650
proc getClip * (): (int ,int ,int ,int ) =
654
651
# # returns the clipping rectangle as x,y,w,h
655
652
return (clipMinX,clipMinY,clipMaxX- clipMinX,clipMaxY- clipMinY)
@@ -1073,9 +1070,6 @@ proc pgetRGB*(x,y: Pint): (uint8,uint8,uint8) =
1073
1070
return (0 'u8 ,0 'u8 ,0 'u8 )
1074
1071
return palCol (swCanvas.data[y* swCanvas.w+ x].ColorId )
1075
1072
1076
- template rectfill * (t: (int ,int ,int ,int )) =
1077
- rectfill (t[0 ], t[1 ], t[0 ]+ t[2 ]- 1 , t[1 ]+ t[3 ]- 1 )
1078
-
1079
1073
proc rectfill * (x1,y1,x2,y2: Pint ) =
1080
1074
# # draws a filled rectangle from two points
1081
1075
let minx = min (x1,x2) - cameraX
@@ -1087,9 +1081,6 @@ proc rectfill*(x1,y1,x2,y2: Pint) =
1087
1081
for x in max (minx,clipMinX).. min (maxx,clipMaxX):
1088
1082
psetRaw (x,y,currentColor)
1089
1083
1090
- template rrectfill * (t: (int ,int ,int ,int ), r = 1 ) =
1091
- rrectfill (t[0 ], t[1 ], t[0 ]+ t[2 ]- 1 , t[1 ]+ t[3 ]- 1 , r)
1092
-
1093
1084
proc rrectfill * (x1,y1,x2,y2: Pint , r: Pint = 1 ) =
1094
1085
# # draws a filled rounded rectangle from two points, r specifies radius
1095
1086
let minx = min (x1,x2)
@@ -1106,36 +1097,24 @@ proc rrectfill*(x1,y1,x2,y2: Pint, r: Pint = 1) =
1106
1097
rectfill (minx + r, miny, maxx - r, miny + r)
1107
1098
rectfill (minx + r, maxy - r, maxx - r, maxy)
1108
1099
1109
- template box * (t: (int ,int ,int ,int )) =
1110
- box (t[0 ], t[1 ], t[2 ], t[3 ])
1111
-
1112
1100
proc box * (x,y,w,h: Pint ) =
1113
1101
# # draws a hollow rectangle from position and size
1114
1102
hline (x,y,x+ w- 1 )
1115
1103
vline (x,y,y+ h- 1 )
1116
1104
vline (x+ w- 1 ,y,y+ h- 1 )
1117
1105
hline (x,y+ h- 1 ,x+ w- 1 )
1118
1106
1119
- template boxfill * (t: (int ,int ,int ,int )) =
1120
- boxfill (t[0 ], t[1 ], t[2 ], t[3 ])
1121
-
1122
1107
proc boxfill * (x,y,w,h: Pint ) =
1123
1108
# # draws a filled rectangle from position and size
1124
1109
if w == 0 or h == 0 :
1125
1110
return
1126
1111
for y in y..< y+ h:
1127
1112
hline (x,y,x+ w- 1 )
1128
1113
1129
- template rbox * (t: (int ,int ,int ,int ), r = 1 ) =
1130
- rbox (t[0 ], t[1 ], t[2 ], t[3 ], r)
1131
-
1132
1114
proc rbox * (x,y,w,h: Pint , r: Pint = 1 ) =
1133
1115
# # draws a hollow rounded rectangle from position and size, r specifies radius
1134
1116
rrect (x,y,x+ w- 1 ,y+ h- 1 ,r)
1135
1117
1136
- template rboxfill * (t: (int ,int ,int ,int ), r = 1 ) =
1137
- rboxfill (t[0 ], t[1 ], t[2 ], t[3 ], r)
1138
-
1139
1118
proc rboxfill * (x,y,w,h: Pint , r: Pint = 1 ) =
1140
1119
# # draws a filled rounded rectangle from position and size, r specifies radius
1141
1120
rrectfill (x,y,x+ w- 1 ,y+ h- 1 ,r)
@@ -1276,9 +1255,6 @@ proc lineDashed*(x0,y0,x1,y1: Pint, pattern: uint8 = 0b10101010) =
1276
1255
if (pattern and (1 shl i).uint8 ) != 0 :
1277
1256
pset (x,y)
1278
1257
1279
- template rect * (t: (int ,int ,int ,int )) =
1280
- rect (t[0 ], t[1 ], t[0 ]+ t[2 ]- 1 , t[1 ]+ t[3 ]- 1 )
1281
-
1282
1258
proc rect * (x1,y1,x2,y2: Pint ) =
1283
1259
# # draws a rectangle defined by two points
1284
1260
let w = x2- x1
@@ -1294,9 +1270,6 @@ proc rect*(x1,y1,x2,y2: Pint) =
1294
1270
# left
1295
1271
vline (x, y+ 1 , y+ h- 1 )
1296
1272
1297
- template rrect * (t: (int ,int ,int ,int ), r = 1 ) =
1298
- rrect (t[0 ], t[1 ], t[0 ]+ t[2 ]- 1 , t[1 ]+ t[3 ]- 1 , r)
1299
-
1300
1273
proc rrect * (x1,y1,x2,y2: Pint , r: Pint = 1 ) =
1301
1274
# # draws a rounded rectangle, radius defined by r
1302
1275
@@ -1379,9 +1352,6 @@ proc rrect*(x1,y1,x2,y2: Pint, r: Pint = 1) =
1379
1352
vline (minx, miny + r, maxy - r)
1380
1353
vline (maxx, miny + r, maxy - r)
1381
1354
1382
- template rectCorner * (t: (int ,int ,int ,int )) =
1383
- rectCorner (t[0 ], t[1 ], t[0 ]+ t[2 ]- 1 , t[1 ]+ t[3 ]- 1 )
1384
-
1385
1355
proc rectCorner * (x1,y1,x2,y2: Pint ) =
1386
1356
# # draws the corners of a rectangle
1387
1357
let x = x1
@@ -1403,9 +1373,6 @@ proc rectCorner*(x1,y1,x2,y2: Pint) =
1403
1373
pset (x2- 1 , y2)
1404
1374
pset (x2, y2- 1 )
1405
1375
1406
- template rrectCorner * (t: (int ,int ,int ,int )) =
1407
- rrectCorner (t[0 ], t[1 ], t[0 ]+ t[2 ]- 1 , t[1 ]+ t[3 ]- 1 )
1408
-
1409
1376
proc rrectCorner * (x1,y1,x2,y2: Pint ) =
1410
1377
# # draws the corners of a rounded rectangle
1411
1378
let x = x1
0 commit comments