-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Change from Rectangle<num>/Point<num> to Rect/Offset for ui convenience #1163
Conversation
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) ]]; |
There was a problem hiding this comment.
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) ]]; |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
…onvenience (flutter#1163)" This reverts commit 12b8e48.
Also fixes a bug where iOS was not getting corner point results.