q5play 4.0.4 → 4.0.5
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 +1 -1
- package/q5play.js +15 -11
package/package.json
CHANGED
package/q5play.js
CHANGED
|
@@ -1504,11 +1504,11 @@ async function q5playPreSetup(q) {
|
|
|
1504
1504
|
} else {
|
|
1505
1505
|
let hw = (w * 0.5) / meterSize;
|
|
1506
1506
|
let hh = (h * 0.5) / meterSize;
|
|
1507
|
-
rr
|
|
1507
|
+
let _rr = rr / meterSize;
|
|
1508
1508
|
|
|
1509
1509
|
if (rr) {
|
|
1510
|
-
hw = Math.max(hw -
|
|
1511
|
-
hh = Math.max(hh -
|
|
1510
|
+
hw = Math.max(hw - _rr, 0.001);
|
|
1511
|
+
hh = Math.max(hh - _rr, 0.001);
|
|
1512
1512
|
}
|
|
1513
1513
|
|
|
1514
1514
|
if (offsetX || offsetY) {
|
|
@@ -1516,26 +1516,29 @@ async function q5playPreSetup(q) {
|
|
|
1516
1516
|
|
|
1517
1517
|
if (!rr) geom = b2MakeOffsetBox(hw, hh, offset, ZERO_ROT);
|
|
1518
1518
|
else {
|
|
1519
|
-
geom = b2MakeOffsetRoundedBox(hw, hh, offset, ZERO_ROT,
|
|
1519
|
+
geom = b2MakeOffsetRoundedBox(hw, hh, offset, ZERO_ROT, _rr);
|
|
1520
1520
|
}
|
|
1521
1521
|
} else {
|
|
1522
1522
|
if (!rr) geom = b2MakeBox(hw, hh);
|
|
1523
|
-
else geom = b2MakeRoundedBox(hw, hh,
|
|
1523
|
+
else geom = b2MakeRoundedBox(hw, hh, _rr);
|
|
1524
1524
|
}
|
|
1525
1525
|
|
|
1526
1526
|
geom._hw = hw;
|
|
1527
1527
|
geom._hh = hh;
|
|
1528
|
-
geom._rr =
|
|
1528
|
+
geom._rr = _rr;
|
|
1529
1529
|
|
|
1530
1530
|
id = b2CreatePolygonShape(bdID, shape.def, geom);
|
|
1531
1531
|
shape._init(id, 0, geom);
|
|
1532
1532
|
}
|
|
1533
1533
|
|
|
1534
1534
|
// TODO: use AABB to get extents
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1535
|
+
if (!shapes.length) {
|
|
1536
|
+
this._w = w;
|
|
1537
|
+
this._hw = w * 0.5;
|
|
1538
|
+
this._h = h;
|
|
1539
|
+
this._hh = h * 0.5;
|
|
1540
|
+
this._roundedRadius = rr;
|
|
1541
|
+
}
|
|
1539
1542
|
}
|
|
1540
1543
|
|
|
1541
1544
|
if (shape) {
|
|
@@ -3109,8 +3112,9 @@ async function q5playPreSetup(q) {
|
|
|
3109
3112
|
|
|
3110
3113
|
// exclude props that are inherited in a special way or not traits
|
|
3111
3114
|
const spriteStdInheritedProps = $.Sprite.propsAll.filter(
|
|
3115
|
+
// prettier-ignore
|
|
3112
3116
|
(p) =>
|
|
3113
|
-
!['ani', 'd', 'diameter', 'h', 'height', 'physics', 'scale', 'tile', 'w', 'width', 'vel', 'x', 'y'].includes(p)
|
|
3117
|
+
!['ani', 'd', 'diameter', 'h', 'height', 'physics', 'scale', 'tile', 'w', 'width', 'vel', 'x', 'y', 'roundedRadius'].includes(p)
|
|
3114
3118
|
);
|
|
3115
3119
|
|
|
3116
3120
|
let groupKeys = {};
|