@@ -245,28 +245,19 @@ void DrawRoundedRectangle(ICanvas canvas, RectF dirtyRect)
245
245
canvas . CanvasSaveState ( ) ;
246
246
canvas . Antialias = true ;
247
247
float strokeRadius = ( float ) itemInfo . StrokeThickness / 2f ;
248
+ canvas . StrokeSize = ( float ) itemInfo . StrokeThickness ;
249
+ canvas . StrokeColor = SegmentViewHelper . BrushToColorConverter ( itemInfo . Stroke ) ;
248
250
CornerRadius cornerRadius = itemInfo . SegmentCornerRadius ;
249
251
250
252
// Calculate corner radius values, subtracting stroke radius when there's stroke thickness
251
- float cornerRadiusTopLeft = itemInfo . StrokeThickness > 0 ? ( float ) cornerRadius . TopLeft - strokeRadius : ( float ) cornerRadius . TopLeft ;
252
- float cornerRadiusTopRight = itemInfo . StrokeThickness > 0 ? ( float ) cornerRadius . TopRight - strokeRadius : ( float ) cornerRadius . TopRight ;
253
- float cornerRadiusBottomRight = itemInfo . StrokeThickness > 0 ? ( float ) cornerRadius . BottomRight - strokeRadius : ( float ) cornerRadius . BottomRight ;
254
- float cornerRadiusBottomLeft = itemInfo . StrokeThickness > 0 ? ( float ) cornerRadius . BottomLeft - strokeRadius : ( float ) cornerRadius . BottomLeft ;
255
-
256
- // Always draw the background
253
+ float cornerRadiusTopLeft = ( float ) cornerRadius . TopLeft - strokeRadius ;
254
+ float cornerRadiusTopRight = ( float ) cornerRadius . TopRight - strokeRadius ;
255
+ float cornerRadiusBottomRight = ( float ) cornerRadius . BottomRight - strokeRadius ;
256
+ float cornerRadiusBottomLeft = ( float ) cornerRadius . BottomLeft - strokeRadius ;
257
257
bool isEnabled = SegmentViewHelper . GetItemEnabled ( itemInfo , _segmentItem ) ;
258
258
Brush background = isEnabled ? SegmentViewHelper . GetSegmentBackground ( itemInfo , _segmentItem ) : itemInfo . DisabledSegmentBackground ;
259
259
canvas . FillColor = SegmentViewHelper . BrushToColorConverter ( background ) ;
260
260
canvas . FillRoundedRectangle ( dirtyRect . Left , dirtyRect . Top , dirtyRect . Width , dirtyRect . Height , cornerRadiusTopLeft , cornerRadiusTopRight , cornerRadiusBottomRight , cornerRadiusBottomLeft ) ;
261
-
262
- // Only draw stroke if stroke thickness is greater than 0
263
- if ( itemInfo . StrokeThickness > 0 )
264
- {
265
- canvas . StrokeSize = ( float ) itemInfo . StrokeThickness ;
266
- canvas . StrokeColor = SegmentViewHelper . BrushToColorConverter ( itemInfo . Stroke ) ;
267
- canvas . DrawRoundedRectangle ( dirtyRect . Left , dirtyRect . Top , dirtyRect . Width , dirtyRect . Height , cornerRadiusTopLeft , cornerRadiusTopRight , cornerRadiusBottomRight , cornerRadiusBottomLeft ) ;
268
- }
269
-
270
261
canvas . CanvasRestoreState ( ) ;
271
262
}
272
263
0 commit comments