mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 21:16:00 +02:00
Add getters/setters to Grid
This commit is contained in:
parent
a474243f08
commit
9a6bce3767
1 changed files with 26 additions and 3 deletions
|
@ -27,9 +27,6 @@ Grid = function(opts) {
|
|||
majorGridEvery: 2,
|
||||
});
|
||||
|
||||
that.getMinorIncrement = function() { return minorGridSpacing; };
|
||||
that.getMajorIncrement = function() { return minorGridSpacing * majorGridEvery; };
|
||||
|
||||
that.visible = false;
|
||||
that.enabled = false;
|
||||
|
||||
|
@ -37,13 +34,39 @@ Grid = function(opts) {
|
|||
return origin;
|
||||
}
|
||||
|
||||
that.getMinorIncrement = function() { return minorGridWidth; };
|
||||
that.getMajorIncrement = function() { return minorGridWidth * majorGridEvery; };
|
||||
|
||||
that.getMinorGridWidth = function() { return minorGridWidth; };
|
||||
that.setMinorGridWidth = function(value) {
|
||||
minorGridWidth = value;
|
||||
updateGrid();
|
||||
};
|
||||
|
||||
that.getMajorGridEvery = function() { return majorGridEvery; };
|
||||
that.setMajorGridEvery = function(value) {
|
||||
majorGridEvery = value;
|
||||
updateGrid();
|
||||
};
|
||||
|
||||
that.getColorIndex = function() { return colorIndex; };
|
||||
that.setColorIndex = function(value) {
|
||||
colorIndex = value;
|
||||
updateGrid();
|
||||
};
|
||||
|
||||
that.getSnapToGrid = function() { return snapToGrid; };
|
||||
that.setSnapToGrid = function(value) {
|
||||
snapToGrid = value;
|
||||
that.emitUpdate();
|
||||
};
|
||||
|
||||
that.setEnabled = function(enabled) {
|
||||
that.enabled = enabled;
|
||||
updateGrid();
|
||||
}
|
||||
|
||||
that.getVisible = function() { return that.visible; };
|
||||
that.setVisible = function(visible, noUpdate) {
|
||||
that.visible = visible;
|
||||
updateGrid();
|
||||
|
|
Loading…
Reference in a new issue