summaryrefslogtreecommitdiff
path: root/draw.c
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2019-09-28 22:31:28 +0100
committerKatolaZ <katolaz@freaknet.org>2019-09-28 22:31:28 +0100
commit646c1c1cc7ecc0cef7f619ae01457659817e5d05 (patch)
tree83f366db3104f3689426825c514f53dfe2d3a70c /draw.c
parent47a17a404c2faabc3db70df3a7a64a462a1a9d21 (diff)
fix bug in toggle_trapezium
Diffstat (limited to 'draw.c')
-rw-r--r--draw.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/draw.c b/draw.c
index 822113f..51a27b2 100644
--- a/draw.c
+++ b/draw.c
@@ -251,15 +251,17 @@ void draw_trapezium(int x1, int y1, char st, char fix){
for(i=xmin+1; i<=xmax; i++){
f(i, ylong, line_h);
}
- for(i=xmin+xoff; i<=xmax-xoff; i++){
- f(i, yshort, line_h);
+ if (st & 0x02){ /* Centred trapezium */
+ for(i=xmin+xoff; i<=xmax-xoff; i++){
+ f(i, yshort, line_h);
+ }
}
f(xmin+xoff, yshort, corner);
f(xmin, ylong, corner);
f(xmax-xoff, yshort, corner);
f(xmax, ylong, corner);
xoff --;
- if ((st & BOX_TRAP_D) == BOX_TRAP_D)
+ if ((st & BOX_TRAP_DC) == BOX_TRAP_DC)
xoff = 1;
for(i=ymin+1; i<ymax; i++, xoff += xincr){
f(xmin + xoff, i, left_c);
@@ -291,11 +293,13 @@ void update_box(int x1, int y1, char st, char fix){
char toggle_trap_type(char st){
if (st & BOX_TRAP){
- if (st < BOX_TRAP_DR)
- st ++;
+ if (st != BOX_TRAP_DR)
+ st += 1;
else
st = BOX_TRAP_UR;
}
+ if (st == BOX_TRAP_D)
+ st += 1;
return st;
}