From dfdb09698fe6799e6a1712937731b6ad76b366df Mon Sep 17 00:00:00 2001 From: bitbegin Date: Sun, 15 Mar 2020 10:10:25 +0800 Subject: [PATCH] FIX: image's alpha channel not right --- runtime/image-utils.reds | 2 +- runtime/platform/image-gdk.reds | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/runtime/image-utils.reds b/runtime/image-utils.reds index 14fabb4b88..34d3686f30 100644 --- a/runtime/image-utils.reds +++ b/runtime/image-utils.reds @@ -219,7 +219,7 @@ image-utils: context [ src.h: as float! sh size: rect.w * rect.h * 4 rgba: as int-ptr! allocate size - set-memory as byte-ptr! rgba #"^(FF)" size + set-memory as byte-ptr! rgba #"^(00)" size i: 0 j: 0 loop rect.h [ i: 0 diff --git a/runtime/platform/image-gdk.reds b/runtime/platform/image-gdk.reds index adf51fb91f..f3bcac8e31 100644 --- a/runtime/platform/image-gdk.reds +++ b/runtime/platform/image-gdk.reds @@ -296,9 +296,7 @@ OS-image: context [ b: p/1 p/1: p/3 p/3: b - either alpha? [ - p/4: #"^(FF)" - p/4 - ][ + unless alpha? [ p/4: #"^(FF)" ] dst/offset: old