Skip to content

Commit

Permalink
Merge pull request #149 from Afroz-Shaikh/fix-147
Browse files Browse the repository at this point in the history
Fix-147
  • Loading branch information
hasnentai authored Mar 29, 2023
2 parents 0b9256d + fe0f61e commit 51baa0e
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 27 deletions.
3 changes: 0 additions & 3 deletions lib/linear_gauge/linear_gauge_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1606,9 +1606,6 @@ class RenderLinearGauge extends RenderBox {
}

return constraints.constrain(_axisActualSize);



}

@override
Expand Down
75 changes: 51 additions & 24 deletions lib/linear_gauge/value_bar/value_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -284,35 +284,62 @@ class ValueBar {
required Rect gaugeContainer,
required var linearGauge,
}) {
GaugeOrientation gaugeOrientation = linearGauge.getGaugeOrientation;
var rectangularBox;
switch (edgeStyle) {
case LinearEdgeStyle.startCurve:
rectangularBox = RRect.fromRectAndCorners(
gaugeContainer,
topLeft: Radius.circular(borderRadius!),
bottomLeft:
(linearGauge.getGaugeOrientation == GaugeOrientation.horizontal)
? Radius.circular(borderRadius!)
: Radius.zero,
topRight:
(linearGauge.getGaugeOrientation == GaugeOrientation.horizontal)
? Radius.zero
: Radius.circular(borderRadius!),
);
gaugeOrientation == GaugeOrientation.horizontal
? rectangularBox = RRect.fromRectAndCorners(
gaugeContainer,
topLeft: Radius.circular(borderRadius!),
bottomLeft: (linearGauge.getGaugeOrientation ==
GaugeOrientation.horizontal)
? Radius.circular(borderRadius!)
: Radius.zero,
topRight: (linearGauge.getGaugeOrientation ==
GaugeOrientation.horizontal)
? Radius.zero
: Radius.circular(borderRadius!),
)
: rectangularBox = RRect.fromRectAndCorners(
gaugeContainer,
topRight: (linearGauge.getGaugeOrientation ==
GaugeOrientation.horizontal)
? Radius.circular(borderRadius!)
: Radius.zero,
bottomLeft: (linearGauge.getGaugeOrientation ==
GaugeOrientation.horizontal)
? Radius.zero
: Radius.circular(borderRadius!),
bottomRight: Radius.circular(borderRadius!),
);
break;
case LinearEdgeStyle.endCurve:
rectangularBox = RRect.fromRectAndCorners(
gaugeContainer,
topRight:
(linearGauge.getGaugeOrientation == GaugeOrientation.horizontal)
? Radius.circular(borderRadius!)
: Radius.zero,
bottomLeft:
(linearGauge.getGaugeOrientation == GaugeOrientation.horizontal)
? Radius.zero
: Radius.circular(borderRadius!),
bottomRight: Radius.circular(borderRadius!),
);
gaugeOrientation == GaugeOrientation.horizontal
? rectangularBox = RRect.fromRectAndCorners(
gaugeContainer,
topRight: (linearGauge.getGaugeOrientation ==
GaugeOrientation.horizontal)
? Radius.circular(borderRadius!)
: Radius.zero,
bottomLeft: (linearGauge.getGaugeOrientation ==
GaugeOrientation.horizontal)
? Radius.zero
: Radius.circular(borderRadius!),
bottomRight: Radius.circular(borderRadius!),
)
: rectangularBox = RRect.fromRectAndCorners(
gaugeContainer,
topLeft: Radius.circular(borderRadius!),
bottomLeft: (linearGauge.getGaugeOrientation ==
GaugeOrientation.horizontal)
? Radius.circular(borderRadius!)
: Radius.zero,
topRight: (linearGauge.getGaugeOrientation ==
GaugeOrientation.horizontal)
? Radius.zero
: Radius.circular(borderRadius!),
);
break;

default:
Expand Down

0 comments on commit 51baa0e

Please sign in to comment.