|
Split Size into Size and Offset.
Added a OffsetBase class that Size now inherits from, and added a new
Offset class that also inherits from OffsetBase.
Offset has:
- dx and dy members
- zero and infinite static constants
- a method that returns a new Offset that's the existing one scaled
by a scalar
- a unary minus operator
- operators overloads such that subtracting or adding two Offsets
gives another Offset
- a toPoint() method
Added Offset and Size to the dart bindings, so they can be used from C++.
Changed the Canvas API to use Point, Size, and Offset where appropriate:
- drawLine uses Points now
- drawCircle uses a Point now
- drawImage uses a Paint now
- the constructor uses a Size
Changed Point as follows:
- added a unary minus
- Point difference now gives an Offset rather than a Size
- You can add an Offset to a Point to get a new Point
- toSize() has been replaced by toOffset()
Changed Rect as follows:
- renamed upperLeft and lowerRight to topLeft and bottomRight for
consistency with our other APIs
- added bottomLeft and topRight for completeness
Changed Size as follows:
- now inherits from OffsetBase
- added *, /, ~/, and % operators for scaling sizes
- subtracting a Size from a Size gives an Offset
- subtracting an Offset from a Size gives a Size
- changed the + operator to take an Offset instead of a Size
- added topLeft, bottomLeft, topRight, bottomRight to match Rect
- added center for the same reason
- added shortestSide getter since that was a common pattern
- removed toPoint()
Changed DrawLooperLayerInfo as follows:
- setOffset member takes an Offset instead of a Point
Changed BoxConstraints as follows:
- added biggest getter since it was a common pattern
- added smallest getter for symmetry
Changed BoxShadow as follows:
- offset member is an Offset rather than a Size
Changed ViewConstraints as follows:
- replaced height and width members by a single size member
I did some minor code cleanup in nearby files while I was there,
including sorting sky/engine/core/core.gni alphabetically, and fixing
some warnings in the examples.
BUG=
R=abarth@chromium.org, chinmaygarde@google.com
Committed: https://chromium.googlesource.com/external/mojo/+/196833cdb92a7cdada6f60aa95d45a1aa54cf378
Total comments: 3
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+455 lines, -386 lines) |
Patch |
 |
M |
sky/engine/bindings/scripts/dart_types.py
|
View
|
|
2 chunks |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
M |
sky/engine/bindings/scripts/templates/interface_dart.template
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
sky/engine/core/core.gni
|
View
|
|
34 chunks |
+161 lines, -157 lines |
0 comments
|
Download
|
 |
M |
sky/engine/core/painting/Canvas.h
|
View
|
|
4 chunks |
+8 lines, -9 lines |
0 comments
|
Download
|
 |
M |
sky/engine/core/painting/Canvas.cpp
|
View
|
|
3 chunks |
+6 lines, -9 lines |
0 comments
|
Download
|
 |
M |
sky/engine/core/painting/Canvas.idl
|
View
|
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
sky/engine/core/painting/DrawLooperLayerInfo.h
|
View
|
|
2 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
sky/engine/core/painting/DrawLooperLayerInfo.idl
|
View
|
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
 |
M |
sky/engine/core/painting/Image.idl
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
A + |
sky/engine/core/painting/Offset.h
|
View
|
1
|
1 chunk |
+10 lines, -10 lines |
0 comments
|
Download
|
 |
A + |
sky/engine/core/painting/Offset.cpp
|
View
|
1
|
2 chunks |
+14 lines, -17 lines |
0 comments
|
Download
|
 |
A |
sky/engine/core/painting/Offset.dart
|
View
|
1
|
1 chunk |
+29 lines, -0 lines |
0 comments
|
Download
|
 |
A |
sky/engine/core/painting/OffsetBase.dart
|
View
|
1
|
1 chunk |
+28 lines, -0 lines |
0 comments
|
Download
|
 |
M |
sky/engine/core/painting/Point.cpp
|
View
|
|
1 chunk |
+2 lines, -5 lines |
0 comments
|
Download
|
 |
M |
sky/engine/core/painting/Point.dart
|
View
|
1
2
|
1 chunk |
+5 lines, -4 lines |
0 comments
|
Download
|
 |
M |
sky/engine/core/painting/Rect.dart
|
View
|
|
3 chunks |
+5 lines, -3 lines |
0 comments
|
Download
|
 |
A + |
sky/engine/core/painting/Size.h
|
View
|
1
|
1 chunk |
+10 lines, -10 lines |
0 comments
|
Download
|
 |
A + |
sky/engine/core/painting/Size.cpp
|
View
|
1
|
2 chunks |
+14 lines, -17 lines |
0 comments
|
Download
|
 |
M |
sky/engine/core/painting/Size.dart
|
View
|
1
2
3
|
1 chunk |
+32 lines, -20 lines |
0 comments
|
Download
|
 |
M |
sky/engine/core/script/dom_dart_state.h
|
View
|
|
2 chunks |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
M |
sky/engine/core/script/dom_dart_state.cc
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
sky/engine/core/view/View.idl
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/example/game/lib/game_demo_world.dart
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/example/game/lib/sprite.dart
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/example/game/lib/sprite_box.dart
|
View
|
1
2
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/example/raw/baseline.dart
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/example/raw/hello_world.dart
|
View
|
1
2
|
1 chunk |
+4 lines, -5 lines |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/example/raw/launcher.dart
|
View
|
1
2
|
1 chunk |
+4 lines, -5 lines |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/example/raw/painting.dart
|
View
|
1
2
|
5 chunks |
+9 lines, -8 lines |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/example/raw/shadow.dart
|
View
|
1
2
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/example/raw/spinning_arabic.dart
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/example/raw/spinning_image.dart
|
View
|
1
2
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/example/raw/spinning_square.dart
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/example/rendering/touch_demo.dart
|
View
|
1
2
|
3 chunks |
+23 lines, -24 lines |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/example/stocks2/lib/stock_arrow.dart
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/example/widgets/sector.dart
|
View
|
1
2
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/painting/box_painter.dart
|
View
|
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/painting/shadows.dart
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/rendering/box.dart
|
View
|
|
7 chunks |
+11 lines, -13 lines |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/rendering/object.dart
|
View
|
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/rendering/sky_binding.dart
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/rendering/stack.dart
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/theme/shadows.dart
|
View
|
|
2 chunks |
+11 lines, -11 lines |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/widgets/basic.dart
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/widgets/ink_well.dart
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/widgets/radio.dart
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/widgets/scaffold.dart
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/widgets/switch.dart
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
sky/sdk/lib/widgets/widget.dart
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
sky/tests/examples/stocks-expected.txt
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
sky/tests/resources/display_list.dart
|
View
|
|
6 chunks |
+14 lines, -16 lines |
0 comments
|
Download
|
 |
M |
sky/tests/widgets/buttons-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
Total messages: 7 (3 generated)
|