Skip to content

Commit

Permalink
Add indicator for scale proportion, closes #616
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Jan 22, 2025
1 parent ef9782c commit 22546e1
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 94 deletions.
2 changes: 1 addition & 1 deletion app/android/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GEM
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.1040.0)
aws-partitions (1.1041.0)
aws-sdk-core (3.216.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
Expand Down
22 changes: 22 additions & 0 deletions app/lib/renderers/foregrounds/select.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:butterfly/renderers/renderer.dart';
import 'package:butterfly_api/butterfly_api.dart';
import 'package:flutter/material.dart';
import 'package:material_leap/material_leap.dart';
import 'package:phosphor_flutter/phosphor_flutter.dart';

const cornerSize = 40.0;
const visibleSize = cornerSize / 2.5;
Expand Down Expand Up @@ -300,6 +301,27 @@ class RectSelectionForegroundRenderer extends Renderer<Rect> {
);
}
});

final icon = transformMode == SelectionScaleMode.scaleProp
? PhosphorIconsFill.lock
: PhosphorIconsLight.lockOpen;
final textPainter = TextPainter(
textDirection: TextDirection.ltr,
text: TextSpan(
text: String.fromCharCode(icon.codePoint),
style: TextStyle(
fontFamily: icon.fontFamily,
package: icon.fontPackage,
fontSize: realSize * 2,
color: color,
),
),
);
textPainter.layout();
textPainter.paint(
canvas,
element.center - Offset(textPainter.width / 2, textPainter.height / 2),
);
}
}

Expand Down
6 changes: 3 additions & 3 deletions app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -640,10 +640,10 @@ packages:
dependency: "direct main"
description:
name: http
sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010
sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f
url: "https://pub.dev"
source: hosted
version: "1.2.2"
version: "1.3.0"
http_multi_server:
dependency: transitive
description:
Expand Down Expand Up @@ -1635,4 +1635,4 @@ packages:
version: "3.1.3"
sdks:
dart: ">=3.6.0 <4.0.0"
flutter: ">=3.27.2"
flutter: ">=3.27.3"
2 changes: 1 addition & 1 deletion app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ version: 2.3.0-beta.2+130

environment:
sdk: ">=3.4.0 <4.0.0"
flutter: 3.27.2
flutter: 3.27.3

dependencies:
flutter:
Expand Down
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
},
"dependencies": {
"@astrojs/check": "^0.9.4",
"@astrojs/react": "^4.1.5",
"@astrojs/react": "^4.1.6",
"@astrojs/starlight": "^0.31.1",
"@phosphor-icons/react": "^2.1.7",
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"astro": "^5.1.7",
"astro": "^5.1.8",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"remark-gemoji": "^8.0.0",
Expand Down
170 changes: 85 additions & 85 deletions docs/pnpm-lock.yaml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions metadata/en-US/changelogs/130.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Add indicator for scale proportion ([#616](https://github.com/LinwoodDev/Butterfly/issues/616))

Read more here: https://linwood.dev/butterfly/2.3.0-beta.2
4 changes: 2 additions & 2 deletions tools/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ packages:
dependency: "direct main"
description:
name: http
sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010
sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f
url: "https://pub.dev"
source: hosted
version: "1.2.2"
version: "1.3.0"
http_parser:
dependency: transitive
description:
Expand Down

0 comments on commit 22546e1

Please sign in to comment.