@@ -31,6 +31,7 @@ public uiMeshMesh strokeMesh {
31
31
StrokeCap _lineCap ;
32
32
StrokeJoin _lineJoin ;
33
33
float _miterLimit ;
34
+ float _fringe ;
34
35
35
36
public static uiPathCache create ( float scale ) {
36
37
uiPathCache newPathCache = ObjectPool < uiPathCache > . alloc ( ) ;
@@ -516,7 +517,9 @@ VertexUV _expandFill(float fringe) {
516
517
517
518
public uiMeshMesh computeStrokeMesh ( float strokeWidth , float fringe , StrokeCap lineCap , StrokeJoin lineJoin , float miterLimit ) {
518
519
if ( this . _strokeMesh != null &&
520
+ this . _fillMesh == null && // Ensure that the cached stroke mesh was not calculated in computeFillMesh
519
521
this . _strokeWidth == strokeWidth &&
522
+ this . _fringe == fringe &&
520
523
this . _lineCap == lineCap &&
521
524
this . _lineJoin == lineJoin &&
522
525
this . _miterLimit == miterLimit ) {
@@ -568,15 +571,18 @@ public uiMeshMesh computeStrokeMesh(float strokeWidth, float fringe, StrokeCap l
568
571
569
572
ObjectPool < uiMeshMesh > . release ( this . _strokeMesh ) ;
570
573
this . _strokeMesh = uiMeshMesh . create ( null , verticesUV . strokeVertices , indices , verticesUV . strokeUV ) ;
574
+ ObjectPool < uiMeshMesh > . release ( this . _fillMesh ) ;
575
+ this . _fillMesh = null ;
571
576
this . _strokeWidth = strokeWidth ;
577
+ this . _fringe = fringe ;
572
578
this . _lineCap = lineCap ;
573
579
this . _lineJoin = lineJoin ;
574
580
this . _miterLimit = miterLimit ;
575
581
return this . _strokeMesh ;
576
582
}
577
583
578
584
public void computeFillMesh ( float fringe , out bool convex ) {
579
- if ( this . _fillMesh != null && ( fringe != 0.0f || this . _strokeMesh != null ) ) {
585
+ if ( this . _fillMesh != null && ( fringe != 0.0f || this . _strokeMesh != null ) && this . _fringe == fringe ) {
580
586
convex = this . _fillConvex ;
581
587
return ;
582
588
}
@@ -670,6 +676,7 @@ public void computeFillMesh(float fringe, out bool convex) {
670
676
671
677
var mesh = uiMeshMesh . create ( null , verticesUV . fillVertices , indices , verticesUV . fillUV ) ;
672
678
this . _fillMesh = mesh ;
679
+ this . _fringe = fringe ;
673
680
}
674
681
}
675
682
}
0 commit comments