Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Change from Rectangle<num>/Point<num> to Rect/Offset for ui convenience #1163

Merged
merged 9 commits into from
Feb 11, 2019

Conversation

bparrishMines
Copy link
Contributor

@bparrishMines bparrishMines commented Feb 5, 2019

Also fixes a bug where iOS was not getting corner point results.

for (NSValue *point in points) {
[points addObject:@[ @(((__bridge CGPoint *)point)->x), @(((__bridge CGPoint *)point)->y) ]];
for (NSValue *point in barcode.cornerPoints) {
[points addObject:@[ @(point.CGPointValue.x), @(point.CGPointValue.y) ]];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bug fix

for (NSValue *point in points) {
[points addObject:@[ @(((__bridge CGPoint *)point)->x), @(((__bridge CGPoint *)point)->y) ]];
for (NSValue *point in cornerPoints) {
[points addObject:@[ @(point.CGPointValue.x), @(point.CGPointValue.y) ]];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

bug fix

@@ -141,12 +140,12 @@ void main() {

final Barcode barcode = barcodes[0];
expect(barcode.valueType, BarcodeValueType.unknown);
expect(barcode.boundingBox, const Rectangle<int>(1, 2, 3, 4));
expect(barcode.boundingBox, Rect.fromLTWH(1.0, 2.0, 3.0, 4.0));

Choose a reason for hiding this comment

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

With implicit int -> conversion in Dart 2.1 could change to ints, unless backwards compatibility a requirement

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think keeping backwards compatibility would be the best move.

The current version only requires 2.0.0 and upgrading to 2.1.0 might not be worth causing another breaking change. The only gain from using 2.1 would make the tests require slightly less code.

@bparrishMines bparrishMines merged commit ec4bdd4 into flutter:master Feb 11, 2019
andreidiaconu pushed a commit to andreidiaconu/plugins that referenced this pull request Feb 17, 2019
andreidiaconu added a commit to andreidiaconu/plugins that referenced this pull request Feb 17, 2019
karantanwar pushed a commit to karantanwar/plugins that referenced this pull request Feb 19, 2019
karantanwar pushed a commit to karantanwar/plugins that referenced this pull request Feb 19, 2019
@bparrishMines bparrishMines deleted the ml_rect branch February 28, 2019 23:24
julianscheel pushed a commit to jusst-engineering/plugins that referenced this pull request Mar 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants