P5-2008 fix inches on gores
This commit is contained in:
Vendored
+7
-1
@@ -1136,6 +1136,7 @@ function GoreHandler(viewport) {
|
||||
* Then round up to get correct number of gores.
|
||||
*/
|
||||
var count = Math.ceil((bounds.width / step).toFixed(5));
|
||||
|
||||
for (var i = 1; i < count; i++) {
|
||||
_lines.push(getLine(bounds.left + step * i));
|
||||
}
|
||||
@@ -2237,6 +2238,7 @@ module.exports = assertKeyValuePair;
|
||||
function calcCrop(obj, width, height, units) {
|
||||
var cropRatio = width / height;
|
||||
var objRatio = obj.width / obj.height;
|
||||
var inchToCm = units === "inch" ? 2.54 : 1;
|
||||
|
||||
var returnValue = {
|
||||
image: obj,
|
||||
@@ -2259,7 +2261,11 @@ function calcCrop(obj, width, height, units) {
|
||||
}
|
||||
|
||||
// Pixels per millimeter
|
||||
returnValue.ppmm = returnValue.width / ((returnValue.dim.width * obj.scaleX) * 10);
|
||||
var ppmm = returnValue.width / ((returnValue.dim.width * inchToCm * obj.scaleX) * 10);
|
||||
|
||||
//Round to four decimal places to avoid precision issues. At least 4 decimals is needed though
|
||||
//for correct calculation of number of gores on wide wallpaperes in editor.
|
||||
returnValue.ppmm = Math.round(ppmm * 1e4) / 1e4;
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user