Skip to content

Commit

Permalink
Add offsetX, offsetY parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
rexrainbow committed Oct 4, 2024
1 parent 9f8da42 commit e54d919
Show file tree
Hide file tree
Showing 85 changed files with 1,012 additions and 345 deletions.
1 change: 1 addition & 0 deletions dist/rexbadgelabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -12171,6 +12171,7 @@
minHeight = gameObject._minHeight;
}
}

if (offsetX === undefined) {
offsetX = 0;
}
Expand Down
32 changes: 24 additions & 8 deletions dist/rexbuttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -12192,7 +12192,7 @@

var LayoutChildren = function () {
var children = this.sizerChildren;
var child, sizerConfig, padding;
var child, childConfig, padding;
var startX = this.innerLeft,
startY = this.innerTop;
var innerWidth = this.innerWidth;
Expand All @@ -12218,8 +12218,8 @@
continue;
}

sizerConfig = child.rexSizer;
padding = sizerConfig.padding;
childConfig = child.rexSizer;
padding = childConfig.padding;

PreLayoutChild.call(this, child);

Expand Down Expand Up @@ -12248,10 +12248,10 @@
// Set position
if (this.orientation === 0) { // x
x = itemX + (padding.left * this.scaleX);
if ((sizerConfig.proportion === 0) || (this.proportionLength === 0)) {
if ((childConfig.proportion === 0) || (this.proportionLength === 0)) {
width = childWidth;
} else {
width = (sizerConfig.proportion * this.proportionLength);
width = (childConfig.proportion * this.proportionLength);
}

y = itemY + (padding.top * this.scaleY);
Expand All @@ -12261,14 +12261,17 @@
width = innerWidth - ((padding.left + padding.right) * this.scaleX);

y = itemY + (padding.top * this.scaleY);
if ((sizerConfig.proportion === 0) || (this.proportionLength === 0)) {
if ((childConfig.proportion === 0) || (this.proportionLength === 0)) {
height = childHeight;
} else {
height = (sizerConfig.proportion * this.proportionLength);
height = (childConfig.proportion * this.proportionLength);
}
}

LayoutChild.call(this, child, x, y, width, height, sizerConfig.align);
LayoutChild.call(this,
child, x, y, width, height, childConfig.align,
childConfig.alignOffsetX, childConfig.alignOffsetY
);

if (this.orientation === 0) { // x
itemX += (width + ((padding.left + padding.right) * this.scaleX) + (this.space.item * this.scaleX));
Expand Down Expand Up @@ -12466,6 +12469,7 @@
childKey, index,
minWidth, minHeight,
fitRatio,
offsetX, offsetY,
) {

AddChild.call(this, gameObject);
Expand All @@ -12491,6 +12495,9 @@
}

fitRatio = GetValue$3(config, 'fitRatio', 0); // width/height

offsetX = GetValue$3(config, 'offsetX', 0);
offsetY = GetValue$3(config, 'offsetY', 0);
}

if (typeof (align) === 'string') {
Expand Down Expand Up @@ -12531,12 +12538,21 @@
fitRatio = GetDisplayWidth(gameObject) / GetDisplayHeight(gameObject);
}

if (offsetX === undefined) {
offsetX = 0;
}
if (offsetY === undefined) {
offsetY = 0;
}

var config = this.getSizerConfig(gameObject);
config.proportion = proportion;
config.align = align;
config.padding = GetBoundsConfig(paddingConfig);
config.expand = expand;
config.fitRatio = (proportion === 0) ? fitRatio : 0;
config.alignOffsetX = offsetX;
config.alignOffsetY = offsetY;

if ((index === undefined) || (index >= this.sizerChildren.length)) {
this.sizerChildren.push(gameObject);
Expand Down
2 changes: 1 addition & 1 deletion dist/rexbuttons.min.js

Large diffs are not rendered by default.

32 changes: 24 additions & 8 deletions dist/rexcolorcomponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -12192,7 +12192,7 @@

var LayoutChildren$2 = function () {
var children = this.sizerChildren;
var child, sizerConfig, padding;
var child, childConfig, padding;
var startX = this.innerLeft,
startY = this.innerTop;
var innerWidth = this.innerWidth;
Expand All @@ -12218,8 +12218,8 @@
continue;
}

sizerConfig = child.rexSizer;
padding = sizerConfig.padding;
childConfig = child.rexSizer;
padding = childConfig.padding;

PreLayoutChild.call(this, child);

Expand Down Expand Up @@ -12248,10 +12248,10 @@
// Set position
if (this.orientation === 0) { // x
x = itemX + (padding.left * this.scaleX);
if ((sizerConfig.proportion === 0) || (this.proportionLength === 0)) {
if ((childConfig.proportion === 0) || (this.proportionLength === 0)) {
width = childWidth;
} else {
width = (sizerConfig.proportion * this.proportionLength);
width = (childConfig.proportion * this.proportionLength);
}

y = itemY + (padding.top * this.scaleY);
Expand All @@ -12261,14 +12261,17 @@
width = innerWidth - ((padding.left + padding.right) * this.scaleX);

y = itemY + (padding.top * this.scaleY);
if ((sizerConfig.proportion === 0) || (this.proportionLength === 0)) {
if ((childConfig.proportion === 0) || (this.proportionLength === 0)) {
height = childHeight;
} else {
height = (sizerConfig.proportion * this.proportionLength);
height = (childConfig.proportion * this.proportionLength);
}
}

LayoutChild.call(this, child, x, y, width, height, sizerConfig.align);
LayoutChild.call(this,
child, x, y, width, height, childConfig.align,
childConfig.alignOffsetX, childConfig.alignOffsetY
);

if (this.orientation === 0) { // x
itemX += (width + ((padding.left + padding.right) * this.scaleX) + (this.space.item * this.scaleX));
Expand Down Expand Up @@ -12466,6 +12469,7 @@
childKey, index,
minWidth, minHeight,
fitRatio,
offsetX, offsetY,
) {

AddChild$2.call(this, gameObject);
Expand All @@ -12491,6 +12495,9 @@
}

fitRatio = GetValue$Q(config, 'fitRatio', 0); // width/height

offsetX = GetValue$Q(config, 'offsetX', 0);
offsetY = GetValue$Q(config, 'offsetY', 0);
}

if (typeof (align) === 'string') {
Expand Down Expand Up @@ -12531,12 +12538,21 @@
fitRatio = GetDisplayWidth(gameObject) / GetDisplayHeight(gameObject);
}

if (offsetX === undefined) {
offsetX = 0;
}
if (offsetY === undefined) {
offsetY = 0;
}

var config = this.getSizerConfig(gameObject);
config.proportion = proportion;
config.align = align;
config.padding = GetBoundsConfig(paddingConfig);
config.expand = expand;
config.fitRatio = (proportion === 0) ? fitRatio : 0;
config.alignOffsetX = offsetX;
config.alignOffsetY = offsetY;

if ((index === undefined) || (index >= this.sizerChildren.length)) {
this.sizerChildren.push(gameObject);
Expand Down
2 changes: 1 addition & 1 deletion dist/rexcolorcomponents.min.js

Large diffs are not rendered by default.

33 changes: 25 additions & 8 deletions dist/rexcolorinput.js
Original file line number Diff line number Diff line change
Expand Up @@ -12192,7 +12192,7 @@

var LayoutChildren$3 = function () {
var children = this.sizerChildren;
var child, sizerConfig, padding;
var child, childConfig, padding;
var startX = this.innerLeft,
startY = this.innerTop;
var innerWidth = this.innerWidth;
Expand All @@ -12218,8 +12218,8 @@
continue;
}

sizerConfig = child.rexSizer;
padding = sizerConfig.padding;
childConfig = child.rexSizer;
padding = childConfig.padding;

PreLayoutChild.call(this, child);

Expand Down Expand Up @@ -12248,10 +12248,10 @@
// Set position
if (this.orientation === 0) { // x
x = itemX + (padding.left * this.scaleX);
if ((sizerConfig.proportion === 0) || (this.proportionLength === 0)) {
if ((childConfig.proportion === 0) || (this.proportionLength === 0)) {
width = childWidth;
} else {
width = (sizerConfig.proportion * this.proportionLength);
width = (childConfig.proportion * this.proportionLength);
}

y = itemY + (padding.top * this.scaleY);
Expand All @@ -12261,14 +12261,17 @@
width = innerWidth - ((padding.left + padding.right) * this.scaleX);

y = itemY + (padding.top * this.scaleY);
if ((sizerConfig.proportion === 0) || (this.proportionLength === 0)) {
if ((childConfig.proportion === 0) || (this.proportionLength === 0)) {
height = childHeight;
} else {
height = (sizerConfig.proportion * this.proportionLength);
height = (childConfig.proportion * this.proportionLength);
}
}

LayoutChild.call(this, child, x, y, width, height, sizerConfig.align);
LayoutChild.call(this,
child, x, y, width, height, childConfig.align,
childConfig.alignOffsetX, childConfig.alignOffsetY
);

if (this.orientation === 0) { // x
itemX += (width + ((padding.left + padding.right) * this.scaleX) + (this.space.item * this.scaleX));
Expand Down Expand Up @@ -12466,6 +12469,7 @@
childKey, index,
minWidth, minHeight,
fitRatio,
offsetX, offsetY,
) {

AddChild$2.call(this, gameObject);
Expand All @@ -12491,6 +12495,9 @@
}

fitRatio = GetValue$Y(config, 'fitRatio', 0); // width/height

offsetX = GetValue$Y(config, 'offsetX', 0);
offsetY = GetValue$Y(config, 'offsetY', 0);
}

if (typeof (align) === 'string') {
Expand Down Expand Up @@ -12531,12 +12538,21 @@
fitRatio = GetDisplayWidth(gameObject) / GetDisplayHeight(gameObject);
}

if (offsetX === undefined) {
offsetX = 0;
}
if (offsetY === undefined) {
offsetY = 0;
}

var config = this.getSizerConfig(gameObject);
config.proportion = proportion;
config.align = align;
config.padding = GetBoundsConfig(paddingConfig);
config.expand = expand;
config.fitRatio = (proportion === 0) ? fitRatio : 0;
config.alignOffsetX = offsetX;
config.alignOffsetY = offsetY;

if ((index === undefined) || (index >= this.sizerChildren.length)) {
this.sizerChildren.push(gameObject);
Expand Down Expand Up @@ -21251,6 +21267,7 @@
minHeight = gameObject._minHeight;
}
}

if (offsetX === undefined) {
offsetX = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/rexcolorinput.min.js

Large diffs are not rendered by default.

33 changes: 25 additions & 8 deletions dist/rexcolorpicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -12192,7 +12192,7 @@

var LayoutChildren$1 = function () {
var children = this.sizerChildren;
var child, sizerConfig, padding;
var child, childConfig, padding;
var startX = this.innerLeft,
startY = this.innerTop;
var innerWidth = this.innerWidth;
Expand All @@ -12218,8 +12218,8 @@
continue;
}

sizerConfig = child.rexSizer;
padding = sizerConfig.padding;
childConfig = child.rexSizer;
padding = childConfig.padding;

PreLayoutChild.call(this, child);

Expand Down Expand Up @@ -12248,10 +12248,10 @@
// Set position
if (this.orientation === 0) { // x
x = itemX + (padding.left * this.scaleX);
if ((sizerConfig.proportion === 0) || (this.proportionLength === 0)) {
if ((childConfig.proportion === 0) || (this.proportionLength === 0)) {
width = childWidth;
} else {
width = (sizerConfig.proportion * this.proportionLength);
width = (childConfig.proportion * this.proportionLength);
}

y = itemY + (padding.top * this.scaleY);
Expand All @@ -12261,14 +12261,17 @@
width = innerWidth - ((padding.left + padding.right) * this.scaleX);

y = itemY + (padding.top * this.scaleY);
if ((sizerConfig.proportion === 0) || (this.proportionLength === 0)) {
if ((childConfig.proportion === 0) || (this.proportionLength === 0)) {
height = childHeight;
} else {
height = (sizerConfig.proportion * this.proportionLength);
height = (childConfig.proportion * this.proportionLength);
}
}

LayoutChild.call(this, child, x, y, width, height, sizerConfig.align);
LayoutChild.call(this,
child, x, y, width, height, childConfig.align,
childConfig.alignOffsetX, childConfig.alignOffsetY
);

if (this.orientation === 0) { // x
itemX += (width + ((padding.left + padding.right) * this.scaleX) + (this.space.item * this.scaleX));
Expand Down Expand Up @@ -12466,6 +12469,7 @@
childKey, index,
minWidth, minHeight,
fitRatio,
offsetX, offsetY,
) {

AddChild.call(this, gameObject);
Expand All @@ -12491,6 +12495,9 @@
}

fitRatio = GetValue$6(config, 'fitRatio', 0); // width/height

offsetX = GetValue$6(config, 'offsetX', 0);
offsetY = GetValue$6(config, 'offsetY', 0);
}

if (typeof (align) === 'string') {
Expand Down Expand Up @@ -12531,12 +12538,21 @@
fitRatio = GetDisplayWidth(gameObject) / GetDisplayHeight(gameObject);
}

if (offsetX === undefined) {
offsetX = 0;
}
if (offsetY === undefined) {
offsetY = 0;
}

var config = this.getSizerConfig(gameObject);
config.proportion = proportion;
config.align = align;
config.padding = GetBoundsConfig(paddingConfig);
config.expand = expand;
config.fitRatio = (proportion === 0) ? fitRatio : 0;
config.alignOffsetX = offsetX;
config.alignOffsetY = offsetY;

if ((index === undefined) || (index >= this.sizerChildren.length)) {
this.sizerChildren.push(gameObject);
Expand Down Expand Up @@ -13187,6 +13203,7 @@
minHeight = gameObject._minHeight;
}
}

if (offsetX === undefined) {
offsetX = 0;
}
Expand Down
Loading

0 comments on commit e54d919

Please sign in to comment.