From 8a8823374ef3dc4154b47c154621cfb3130cf70c Mon Sep 17 00:00:00 2001 From: AllenDang Date: Tue, 27 Jul 2021 21:05:26 +0800 Subject: [PATCH] Use AutoID for ImageWithRgba --- Widgets.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Widgets.go b/Widgets.go index 17fafbb5..8a1339d0 100644 --- a/Widgets.go +++ b/Widgets.go @@ -806,16 +806,8 @@ type ImageWithRgbaWidget struct { } func ImageWithRgba(rgba *image.RGBA) *ImageWithRgbaWidget { - // Generate a unique id from first 100 pix from rgba - var pix []uint8 - if len(rgba.Pix) >= 100 { - pix = rgba.Pix[:100] - } else { - pix = rgba.Pix - } - return &ImageWithRgbaWidget{ - id: fmt.Sprintf("ImageWithRgba_%v", pix), + id: GenAutoID("ImageWithRgba_%v"), width: 100, height: 100, rgba: rgba,