Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
f1642892
Commit
f1642892
authored
Oct 15, 2015
by
Viktor Lidholt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes SpriteBox to work better with native points
parent
79ec7454
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
sprite_box.dart
packages/flutter_sprites/lib/src/sprite_box.dart
+9
-5
No files found.
packages/flutter_sprites/lib/src/sprite_box.dart
View file @
f1642892
...
...
@@ -32,8 +32,10 @@ class SpriteBox extends RenderBox {
if
(
value
==
_rootNode
)
return
;
// Ensure that the root node has a size
assert
(
value
.
size
.
width
>
0
);
assert
(
value
.
size
.
height
>
0
);
assert
(
_transformMode
==
SpriteBoxTransformMode
.
nativePoints
||
value
.
size
.
width
>
0
);
assert
(
_transformMode
==
SpriteBoxTransformMode
.
nativePoints
||
value
.
size
.
height
>
0
);
// Remove sprite box references
if
(
_rootNode
!=
null
)
_removeSpriteBoxReference
(
_rootNode
);
...
...
@@ -101,11 +103,11 @@ class SpriteBox extends RenderBox {
assert
(
rootNode
!=
null
);
assert
(
rootNode
.
_spriteBox
==
null
);
// Setup root node
this
.
rootNode
=
rootNode
;
// Setup transform mode
this
.
transformMode
=
mode
;
// Setup root node
this
.
rootNode
=
rootNode
;
}
void
_removeSpriteBoxReference
(
Node
node
)
{
...
...
@@ -310,6 +312,8 @@ class SpriteBox extends RenderBox {
rootNode
.
size
=
new
Size
(
systemWidth
,
systemHeight
);
break
;
case
SpriteBoxTransformMode
.
nativePoints
:
systemWidth
=
size
.
width
;
systemHeight
=
size
.
height
;
break
;
default
:
assert
(
false
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment