Skip to content

Commit d410ef7

Browse files
authored
some fixes (#87) (#90)
* FIX: perlin.red cannot be compiled. * FIX: disable Draw button while image is processing. * FEAT: minor improvements in ballots demo.
1 parent 54a6da7 commit d410ef7

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

Scripts/mandelbrot.red

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@ mandelIter: function [cx cy maxIter][
2626
]
2727

2828
mandelbrot: function [img xmin xmax ymin ymax iterations][
29+
img/image/argb: white
2930
width: img/image/size/x
3031
height: img/image/size/y
3132
pix: img/image/rgb
3233

33-
img/image/rgb: white
34-
3534
iy: 0
3635
while [iy < height] [
3736
ix: 0
@@ -74,8 +73,10 @@ view [
7473
]
7574
button "Draw" 150x40 [
7675
t0: now/time/precise
76+
face/enabled?: no
7777
mandelbrot img xmin/data xmax/data ymin/data ymax/data iterations/data
7878
dt/data: round now/time/precise - t0
79+
face/enabled?: yes
7980
]
8081
across txt "time (s):" dt: txt
8182
below return

Scripts/perlin.red

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ gen-texture: routine [
9696
-y: -y + 1
9797
yy: yy + coeff
9898
if 255.0 < yy [
99-
yy: yy % 255.0
99+
yy: fmod yy 255.0
100100
y: y + 1
101101
]
102102

@@ -112,7 +112,7 @@ gen-texture: routine [
112112
-x: -x + 1
113113
xx: xx + coeff
114114
if 255.0 < xx [
115-
xx: xx % 255.0
115+
xx: fmod xx 255.0
116116
x: x + 1
117117
]
118118

Showcase/ballots/ballots.red

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ shapes: [
6161
line 13x29 27x29
6262
]
6363
circle: [
64-
at 0x0 person draw [
64+
at 0x0 base transparent draw [
6565
pen gray fill-pen off
6666
line-width 4 disk: circle -1x-1 100
6767
] 260x260
6868
]
6969
circles: [
70-
at 0x0 person draw [
70+
at 0x0 base transparent draw [
7171
pen gray fill-pen off disks:
7272
line-width 1 circle -1x-1 120
7373
line-width 2 circle -1x-1 90

0 commit comments

Comments
 (0)