@urso/core 0.5.6 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urso/core",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "HTML5 game engine",
5
5
  "main": "build/js/index.js",
6
6
  "author": "Megbrimef",
@@ -9,4 +9,5 @@ Urso.Core.Modules.Objects = {
9
9
  Service: require('./service.js'),
10
10
  Styles: require('./styles.js')
11
11
  };
12
+
12
13
  require('./models/_info.js');
@@ -16,8 +16,6 @@ class ModulesObjectsModelsBitmapText extends Urso.Core.Modules.Objects.BaseModel
16
16
 
17
17
  this.fontName = Urso.helper.recursiveGet('fontName', params, false);
18
18
  this.fontSize = Urso.helper.recursiveGet('fontSize', params, false);
19
-
20
- this.maxWidth = Urso.helper.recursiveGet('maxWidth', params, false); //todo
21
19
  }
22
20
 
23
21
  _addBaseObject() {
@@ -118,10 +118,22 @@ class ModulesObjectsProxy {
118
118
  const baseObjectWidth = baseObject._texture ? Math.abs(baseObject.scale.x) * baseObject._texture.orig.width : baseObject.width;
119
119
  const baseObjectHeight = baseObject._texture ? Math.abs(baseObject.scale.y) * baseObject._texture.orig.height : baseObject.height;
120
120
 
121
- if (target.maxWidth && target.maxWidth < baseObjectWidth) //check maxWidth
121
+ if (
122
+ target.maxWidth &&
123
+ (
124
+ target.maxWidth < baseObjectWidth || //maxWidth is lower than object width
125
+ (target.maxWidth > baseObjectWidth && target._baseObject.scale.x < 1) //maxWidth is higher than object width and object is downscaled
126
+ )
127
+ ) //check maxWidth
122
128
  calculationNeed = true;
123
129
 
124
- if (target.maxHeight && target.maxHeight < baseObjectHeight) //check maxHeight
130
+ if (
131
+ target.maxHeight &&
132
+ (
133
+ target.maxHeight < baseObjectHeight || //maxHeight is lower than object height
134
+ (target.maxHeight > baseObjectHeight && target._baseObject.scale.y < 1) //maxHeight is higher than object height and object is downscaled
135
+ )
136
+ ) //check maxHeight
125
137
  calculationNeed = true;
126
138
 
127
139
  if (!calculationNeed)