Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
renderingEngine
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
王剑峰
renderingEngine
Commits
d7737d04
Commit
d7737d04
authored
Nov 06, 2019
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
d711ec43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
Container.ts
src/2d/display/Container.ts
+6
-5
No files found.
src/2d/display/Container.ts
View file @
d7737d04
...
@@ -537,11 +537,11 @@ export default class Container extends DisplayObject {
...
@@ -537,11 +537,11 @@ export default class Container extends DisplayObject {
* 包括子级的,容器的尽量少用,子类可重写
* 包括子级的,容器的尽量少用,子类可重写
* @member {number}
* @member {number}
*/
*/
get
width
()
{
get
width
()
:
number
{
return
this
.
_width
||
this
.
scale
.
x
*
this
.
getLocalBounds
().
width
;
return
this
.
_width
||
this
.
scale
.
x
*
this
.
getLocalBounds
().
width
;
}
}
set
width
(
value
)
{
set
width
(
value
:
number
)
{
// const width = this.getLocalBounds().width;
// const width = this.getLocalBounds().width;
// if (width !== 0) {
// if (width !== 0) {
...
@@ -549,6 +549,7 @@ export default class Container extends DisplayObject {
...
@@ -549,6 +549,7 @@ export default class Container extends DisplayObject {
// } else {
// } else {
// this.scale.x = 1;
// this.scale.x = 1;
// }
// }
if
(
this
.
_width
!==
value
)
this
.
dispatchEvent
(
Event
.
RESIZE
)
//子类有用,有_width,才需设置scaleX
//子类有用,有_width,才需设置scaleX
this
.
_width
=
value
this
.
_width
=
value
}
}
...
@@ -557,11 +558,11 @@ export default class Container extends DisplayObject {
...
@@ -557,11 +558,11 @@ export default class Container extends DisplayObject {
* 高度同width
* 高度同width
* @member {number}
* @member {number}
*/
*/
get
height
()
{
get
height
()
:
number
{
return
this
.
_height
||
this
.
scale
.
y
*
this
.
getLocalBounds
().
height
;
return
this
.
_height
||
this
.
scale
.
y
*
this
.
getLocalBounds
().
height
;
}
}
set
height
(
value
)
{
set
height
(
value
:
number
)
{
// const height = this.getLocalBounds().height;
// const height = this.getLocalBounds().height;
// if (height !== 0) {
// if (height !== 0) {
...
@@ -569,7 +570,7 @@ export default class Container extends DisplayObject {
...
@@ -569,7 +570,7 @@ export default class Container extends DisplayObject {
// } else {
// } else {
// this.scale.y = 1;
// this.scale.y = 1;
// }
// }
if
(
this
.
_height
!==
value
)
this
.
dispatchEvent
(
Event
.
RESIZE
)
this
.
_height
=
value
this
.
_height
=
value
}
}
...
...
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