Skip to content

Commit 9a63e88

Browse files
committed
FIX: not available image size when passed in to an extension (regression)
resolves: Oldes/Rebol-issues#1809
1 parent 2b53189 commit 9a63e88

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/core/f-extension.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ x*/ RXIARG Value_To_RXI(REBVAL *val)
113113
arg.series = VAL_SERIES(val);
114114
arg.width = VAL_IMAGE_WIDE(val);
115115
arg.height = VAL_IMAGE_HIGH(val);
116-
arg.index = VAL_INDEX(val);
116+
// There is no way how to pass index information in one RXIARG value!
117+
//arg.index = VAL_INDEX(val); // Don't do this! index is shared with the size and would overwrite it!
117118
break;
118119
case RXE_TUPLE:
119120
arg.tuple_len = VAL_TUPLE_LEN(val);
@@ -166,7 +167,9 @@ x*/ void RXI_To_Value(REBVAL *val, RXIARG arg, REBCNT type)
166167
VAL_SERIES(val) = arg.series;
167168
VAL_IMAGE_WIDE(val) = arg.width;
168169
VAL_IMAGE_HIGH(val) = arg.height;
169-
VAL_INDEX(val) = arg.index;
170+
// There can be only index or image size in the RXIARG, so the index is
171+
// unfortunatelly lost when image is passed to extension and back!
172+
VAL_INDEX(val) = 0;
170173
break;
171174
case RXE_TUPLE:
172175
VAL_TUPLE_LEN(val) = arg.tuple_len;

0 commit comments

Comments
 (0)