From 540c42d05f6f7aa0523bca47871c79e6c9fe1760 Mon Sep 17 00:00:00 2001 From: Jeremy <53489032+clang-clang-clang@users.noreply.github.com> Date: Tue, 28 Jul 2026 10:39:46 +0800 Subject: [PATCH] Core: fix mesh bounds after setVertex updates --- librtt/Display/Rtt_ShapeAdapterMesh.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/librtt/Display/Rtt_ShapeAdapterMesh.cpp b/librtt/Display/Rtt_ShapeAdapterMesh.cpp index 89770333d..804c96167 100644 --- a/librtt/Display/Rtt_ShapeAdapterMesh.cpp +++ b/librtt/Display/Rtt_ShapeAdapterMesh.cpp @@ -1,6 +1,7 @@ ////////////////////////////////////////////////////////////////////////////// // // This file is part of the Corona game engine. +// With contributions from Dianchu Technology // For overview and more information on licensing please refer to README.md // Home page: https://github.com/coronalabs/corona // Contact: support@coronalabs.com @@ -602,11 +603,16 @@ int ShapeAdapterMesh::setVertex( lua_State *L ) } Vertex2& orig = tesselator->GetMesh().WriteAccess()[vertIndex]; - - if( !Rtt_RealEqual(x, orig.x) || !Rtt_RealEqual(y, orig.y) || zChanged) + + bool xyChanged = !Rtt_RealEqual( x, orig.x ) || !Rtt_RealEqual( y, orig.y ); + if ( xyChanged || zChanged ) { - orig.x = x; - orig.y = y; + if ( xyChanged ) + { + orig.x = x; + orig.y = y; + tesselator->Invalidate(); + } path->Invalidate( ClosedPath::kFillSource | ClosedPath::kStrokeSource );