Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inverse rulers feature created #67

Merged
merged 3 commits into from
Mar 7, 2023

Conversation

SahilSharma2710
Copy link
Collaborator

This PR fixes #48

Screenshot 2023-03-07 at 4 29 03 PM

Offset a;
Offset b;
if (isRulersInversed) {
b = Offset((startLabel.width / 2) + (pointer.width! / 2),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use single source and swap the variables

_startLabelSize = _linearGaugeLabel.getLabelSize(
textStyle: getTextStyle, value: getStart.toInt().toString());
if (getInversedRulers) {
_startLabelSize = _linearGaugeLabel.getLabelSize(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use single line ternary operator to pass the required value in getLabelSize

if (getInversedRulers) {
gaugeContainer = Rect.fromLTWH(start + end, offset.dy, -totalValOnPixel,
getLinearGaugeBoxDecoration.height);
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change this to a single line

getLinearGaugeBoxDecoration.height);

if (getInversedRulers) {
gaugeContainer = Rect.fromLTWH(start + end, offset.dy, -totalValOnPixel,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to single line as well

colorRangeWidth = -1 * colorRangeWidth;
} else {
colorRangeStart =
calculateValuePixelWidth(rangeLinearGauge![i].start) + start;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to ternary

Copy link
Contributor

@hasnentai hasnentai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hasnentai hasnentai merged commit 16f8312 into GeekyAnts:main Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InversedRulers
2 participants