From f499e45631b3d3f5adb97824a259a5aa4ab6c563 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Mon, 29 Jan 2024 23:15:50 +0100 Subject: [PATCH] Fix mouse move crash and font color bug --- src/core/canvas.cpp | 2 +- src/core/widget.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/canvas.cpp b/src/core/canvas.cpp index 9faccfa..eab9f0e 100644 --- a/src/core/canvas.cpp +++ b/src/core/canvas.cpp @@ -769,7 +769,7 @@ void BitmapCanvas::drawGlyph(CanvasTexture* texture, float left, float top, floa uint32_t cgreen = (int32_t)clamp(color.g * 255.0f, 0.0f, 255.0f); uint32_t cblue = (int32_t)clamp(color.b * 255.0f, 0.0f, 255.0f); #ifdef USE_SSE2 - __m128i crgba = _mm_set_epi16(0, cblue, cgreen, cred, 0, cblue, cgreen, cred); + __m128i crgba = _mm_set_epi16(0, cred, cgreen, cblue, 0, cred, cgreen, cblue); #endif float uscale = uvwidth / width; diff --git a/src/core/widget.cpp b/src/core/widget.cpp index 9cf5dda..e27fff1 100644 --- a/src/core/widget.cpp +++ b/src/core/widget.cpp @@ -582,8 +582,10 @@ void Widget::OnWindowMouseMove(const Point& pos) do { widget->OnMouseMove(widget->MapFrom(this, pos)); + if (widget == this) + break; widget = widget->Parent(); - } while (widget != this); + } while (widget); } }