Lots of stuff
This commit is contained in:
2
third-party/mexui/Core/Entity/Component.js
vendored
2
third-party/mexui/Core/Entity/Component.js
vendored
@@ -29,7 +29,7 @@ mexui.Entity.Component.prototype.onMouseMove = function(e, offset)
|
||||
{
|
||||
if(this.moving)
|
||||
{
|
||||
this.position = new Vec2(this.position.x + offset.x, this.position.y + offset.y);
|
||||
this.position = toVector2(this.position.x + offset.x, this.position.y + offset.y);
|
||||
e.used = true;
|
||||
}
|
||||
};
|
||||
|
||||
6
third-party/mexui/Core/Entity/ControlAxis.js
vendored
6
third-party/mexui/Core/Entity/ControlAxis.js
vendored
@@ -19,12 +19,12 @@ mexui.Entity.ControlAxis.prototype.initScrollBar = function()
|
||||
{
|
||||
if(this.isVertical)
|
||||
{
|
||||
var pos = mexui.util.addVec2(this.control.position, new Vec2(this.control.entrySize.x, this.control.entriesPositionOffset.y));
|
||||
var pos = mexui.util.addVec2(this.control.position, toVector2(this.control.entrySize.x, this.control.entriesPositionOffset.y));
|
||||
this.scrollBar = new mexui.Control.ScrollBar(this.control.window, pos.x, pos.y, 25, this.getDisplayedEntriesLength(), true, this.control.styles.scrollBar);
|
||||
}
|
||||
else
|
||||
{
|
||||
var pos = mexui.util.addVec2(this.control.position, new Vec2(this.control.entriesPositionOffset.x, this.control.size.y));
|
||||
var pos = mexui.util.addVec2(this.control.position, toVector2(this.control.entriesPositionOffset.x, this.control.size.y));
|
||||
this.scrollBar = new mexui.Control.ScrollBar(this.control.window, pos.x, pos.y, this.getDisplayedEntriesLength(), 25, false, this.control.styles.scrollBar);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ mexui.Entity.ControlAxis.prototype.getEntryIndexByPoint = function(point)
|
||||
return null;
|
||||
}
|
||||
|
||||
var pos = new Vec2(screenPos.x + this.control.entriesPositionOffset.x, screenPos.y + this.control.entriesPositionOffset.y);
|
||||
var pos = toVector2(screenPos.x + this.control.entriesPositionOffset.x, screenPos.y + this.control.entriesPositionOffset.y);
|
||||
var index = Math.floor((point.y - pos.y) / this.control.entrySize[this.axisIndex]);
|
||||
index += this.getEntryStartIndex();
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
mexui.Entity.ControlWithEntries = function(entriesOutsideControl, manualScrollBar, entriesPositionOffset, entrySize, entriesSizeOffset)
|
||||
{
|
||||
this.entriesOutsideControl = entriesOutsideControl;
|
||||
this.entriesPositionOffset = entriesPositionOffset || new Vec2(0, 0);
|
||||
this.entrySize = entrySize || new Vec2(this.size.x, 25);
|
||||
this.entriesSizeOffset = entriesSizeOffset || new Vec2(0, 0);
|
||||
this.entriesPositionOffset = entriesPositionOffset || toVector2(0, 0);
|
||||
this.entrySize = entrySize || toVector2(this.size.x, 25);
|
||||
this.entriesSizeOffset = entriesSizeOffset || toVector2(0, 0);
|
||||
|
||||
this.axis = {};
|
||||
this.axis.x = new mexui.Entity.ControlAxis(this, false, manualScrollBar, entriesPositionOffset);
|
||||
|
||||
Reference in New Issue
Block a user