@@ -352,7 +352,11 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer
352
352
353
353
context. setFillColor ( dataSet. barShadowColor. cgColor)
354
354
355
- let bezierPath = UIBezierPath ( roundedRect: barRect, byRoundingCorners: dataSet. roundedCorners,
355
+ var roundedCorners = dataSet. roundedCorners
356
+ if barRect. minY < 0 {
357
+ roundedCorners. update ( with: [ . bottomLeft, . bottomRight, . topLeft, . topRight] )
358
+ }
359
+ let bezierPath = UIBezierPath ( roundedRect: barRect, byRoundingCorners: roundedCorners,
356
360
cornerRadii: . init( width: dataSet. cornerRadius, height: dataSet. cornerRadius) )
357
361
context. addPath ( bezierPath. cgPath)
358
362
context. drawPath ( using: . fill)
@@ -383,7 +387,11 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer
383
387
context. setFillColor ( dataSet. color ( atIndex: j) . cgColor)
384
388
}
385
389
386
- let bezierPath = UIBezierPath ( roundedRect: barRect, byRoundingCorners: dataSet. roundedCorners,
390
+ var roundedCorners = dataSet. roundedCorners
391
+ if barRect. minY < 0 {
392
+ roundedCorners. update ( with: [ . bottomLeft, . bottomRight, . topLeft, . topRight] )
393
+ }
394
+ let bezierPath = UIBezierPath ( roundedRect: barRect, byRoundingCorners: roundedCorners,
387
395
cornerRadii: . init( width: dataSet. cornerRadius, height: dataSet. cornerRadius) )
388
396
context. addPath ( bezierPath. cgPath)
389
397
context. drawPath ( using: . fill)
@@ -751,7 +759,11 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer
751
759
752
760
setHighlightDrawPos ( highlight: high, barRect: barRect)
753
761
754
- let bezierPath = UIBezierPath ( roundedRect: barRect, byRoundingCorners: set. roundedCorners,
762
+ var roundedCorners = set. roundedCorners
763
+ if barRect. minY < 0 {
764
+ roundedCorners. update ( with: [ . bottomLeft, . bottomRight, . topLeft, . topRight] )
765
+ }
766
+ let bezierPath = UIBezierPath ( roundedRect: barRect, byRoundingCorners: roundedCorners,
755
767
cornerRadii: . init( width: set. cornerRadius, height: set. cornerRadius) )
756
768
context. addPath ( bezierPath. cgPath)
757
769
context. drawPath ( using: . fill)
0 commit comments