Slider: small refactor to shorten code
parent
b9c5245ba0
commit
2444e75628
|
|
@ -37,24 +37,8 @@ try { // for making it possiblie to run the test app in the following catch stat
|
||||||
dragRect:R,
|
dragRect:R,
|
||||||
},conf);
|
},conf);
|
||||||
|
|
||||||
let totalBorderSize = o.c.outerBorderSize + o.c.innerBorderSize;
|
|
||||||
o.c._xStart = o.c.xStart + totalBorderSize;
|
|
||||||
o.c._width = o.c.width - 2*totalBorderSize;
|
|
||||||
o.c._yStart = o.c.yStart + totalBorderSize;
|
|
||||||
o.c._height = o.c.height - 2*totalBorderSize;
|
|
||||||
o.c.rounded = o.c.rounded?20:0;
|
|
||||||
|
|
||||||
o.c.STEP_SIZE = (o.c._height-(!o.c.rounded?0:(2*o.c.rounded-7)))/o.c.steps;
|
|
||||||
|
|
||||||
if (o.c.horizontal) {
|
if (o.c.horizontal) {
|
||||||
let mediator = o.c._xStart;
|
let mediator = o.c.xStart;
|
||||||
o.c._xStart = o.c._yStart;
|
|
||||||
o.c._yStart = mediator;
|
|
||||||
mediator = o.c._width;
|
|
||||||
o.c._width = o.c._height;
|
|
||||||
o.c._height = mediator;
|
|
||||||
|
|
||||||
mediator = o.c.xStart;
|
|
||||||
o.c.xStart = o.c.yStart;
|
o.c.xStart = o.c.yStart;
|
||||||
o.c.yStart = mediator;
|
o.c.yStart = mediator;
|
||||||
mediator = o.c.width;
|
mediator = o.c.width;
|
||||||
|
|
@ -63,6 +47,15 @@ try { // for making it possiblie to run the test app in the following catch stat
|
||||||
delete mediator;
|
delete mediator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let totalBorderSize = o.c.outerBorderSize + o.c.innerBorderSize;
|
||||||
|
o.c._xStart = o.c.xStart + totalBorderSize;
|
||||||
|
o.c._width = o.c.width - 2*totalBorderSize;
|
||||||
|
o.c._yStart = o.c.yStart + totalBorderSize;
|
||||||
|
o.c._height = o.c.height - 2*totalBorderSize;
|
||||||
|
o.c.rounded = o.c.rounded?20:0;
|
||||||
|
|
||||||
|
o.c.STEP_SIZE = ((!o.c.horizontal?o.c._height:o.c._width)-(!o.c.rounded?0:(2*o.c.rounded-7)))/o.c.steps;
|
||||||
|
|
||||||
o.c.r = {x:o.c.xStart, y:o.c.yStart, x2:o.c.xStart+o.c.width, y2:o.c.yStart+o.c.height, w:o.c.width, h:o.c.height};
|
o.c.r = {x:o.c.xStart, y:o.c.yStart, x2:o.c.xStart+o.c.width, y2:o.c.yStart+o.c.height, w:o.c.width, h:o.c.height};
|
||||||
|
|
||||||
// Initialize the level
|
// Initialize the level
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue