Fixed grid alignment issues with ruler marks when both the ruler and

grid is in metric units
This commit is contained in:
bancika
2020-04-19 21:58:28 +02:00
parent f8b88755e4
commit 61f62b7186
2 changed files with 6 additions and 2 deletions
@@ -39,7 +39,7 @@ public class CalcUtils {
*/ */
public static int roundToGrid(double x, Size gridSpacing) { public static int roundToGrid(double x, Size gridSpacing) {
double grid = gridSpacing.convertToPixels(); double grid = gridSpacing.convertToPixels();
return (int) (Math.round(1f * x / grid) * grid); return (int) Math.round((Math.round(1f * x / grid) * grid));
} }
public static void snapPointToGrid(Point point, Size gridSpacing) { public static void snapPointToGrid(Point point, Size gridSpacing) {
@@ -3017,7 +3017,11 @@
<org.diylc.appframework.update.Change> <org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType> <changeType>NEW_FEATURE</changeType>
<description>Added mirrored pin display options for "DIL IC"</description> <description>Added mirrored pin display options for "DIL IC"</description>
</org.diylc.appframework.update.Change> </org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>
<description>Fixed grid alignment issues with ruler marks when both the ruler and grid is in metric units</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change> <org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType> <changeType>IMPROVEMENT</changeType>
<description>Standardize how folded transistors are displayed - updated TO-92 and TO-1 packages</description> <description>Standardize how folded transistors are displayed - updated TO-92 and TO-1 packages</description>