mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-07 14:04:03 -06:00
Change the scope of the head polygon functions to be inside the main tab
This commit is contained in:
parent
ba229444b7
commit
656e7a8046
1 changed files with 30 additions and 30 deletions
|
@ -494,6 +494,36 @@ Cura.MachineAction
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getHeadPolygonCoord(axis, minMax)
|
||||
{
|
||||
var polygon = JSON.parse(machineHeadPolygonProvider.properties.value);
|
||||
var item = (axis == "x") ? 0 : 1
|
||||
var result = polygon[0][item];
|
||||
for(var i = 1; i < polygon.length; i++) {
|
||||
if (minMax == "min") {
|
||||
result = Math.min(result, polygon[i][item]);
|
||||
} else {
|
||||
result = Math.max(result, polygon[i][item]);
|
||||
}
|
||||
}
|
||||
return Math.abs(result);
|
||||
}
|
||||
|
||||
function setHeadPolygon()
|
||||
{
|
||||
var polygon = [];
|
||||
polygon.push([-parseFloat(printheadXMinField.text), parseFloat(printheadYMaxField.text)]);
|
||||
polygon.push([-parseFloat(printheadXMinField.text),-parseFloat(printheadYMinField.text)]);
|
||||
polygon.push([ parseFloat(printheadXMaxField.text), parseFloat(printheadYMaxField.text)]);
|
||||
polygon.push([ parseFloat(printheadXMaxField.text),-parseFloat(printheadYMinField.text)]);
|
||||
var polygon_string = JSON.stringify(polygon);
|
||||
if(polygon != machineHeadPolygonProvider.properties.value)
|
||||
{
|
||||
machineHeadPolygonProvider.setPropertyValue("value", polygon_string);
|
||||
manager.forceUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -635,36 +665,6 @@ Cura.MachineAction
|
|||
}
|
||||
}
|
||||
|
||||
function getHeadPolygonCoord(axis, minMax)
|
||||
{
|
||||
var polygon = JSON.parse(machineHeadPolygonProvider.properties.value);
|
||||
var item = (axis == "x") ? 0 : 1
|
||||
var result = polygon[0][item];
|
||||
for(var i = 1; i < polygon.length; i++) {
|
||||
if (minMax == "min") {
|
||||
result = Math.min(result, polygon[i][item]);
|
||||
} else {
|
||||
result = Math.max(result, polygon[i][item]);
|
||||
}
|
||||
}
|
||||
return Math.abs(result);
|
||||
}
|
||||
|
||||
function setHeadPolygon()
|
||||
{
|
||||
var polygon = [];
|
||||
polygon.push([-parseFloat(printheadXMinField.text), parseFloat(printheadYMaxField.text)]);
|
||||
polygon.push([-parseFloat(printheadXMinField.text),-parseFloat(printheadYMinField.text)]);
|
||||
polygon.push([ parseFloat(printheadXMaxField.text), parseFloat(printheadYMaxField.text)]);
|
||||
polygon.push([ parseFloat(printheadXMaxField.text),-parseFloat(printheadYMinField.text)]);
|
||||
var polygon_string = JSON.stringify(polygon);
|
||||
if(polygon != machineHeadPolygonProvider.properties.value)
|
||||
{
|
||||
machineHeadPolygonProvider.setPropertyValue("value", polygon_string);
|
||||
manager.forceUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
Component
|
||||
{
|
||||
id: numericTextFieldWithUnit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue