metaeducation / rebol-issues

6 stars 1 forks source link

PAIR! indices into IMAGE! using 0-base, not 1-base #2361

Open hostilefork opened 5 years ago

hostilefork commented 5 years ago
>> i: make image! 2x2
== make image! [2x2 #{
000000000000000000000000
}]

>> i/(2x2): 127.127.127
** Script error: cannot set (2x2) in path i/(2x2):

>> i/(1x1): 127.127.127
== 127.127.127

>> i
== make image! [2x2 #{
0000000000000000007F7F7F
}]

There should be a -1 from the pair X and Y values for that calculation. As a historical note, Rebol2 has the problem as well.

Oldes commented 5 years ago

Not in my branch... I have:

>> i: make image! 2x2
== make image! [2x2 #{
FFFFFFFFFFFFFFFFFFFFFFFF
}]

>> i/(2x2): 0.0.0
== 0.0.0

>> i
== make image! [2x2 #{
FFFFFFFFFFFFFFFFFF000000
}]