1 /*******************************************************************************
2 * Copyright (c) 2020 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Semantum Oy - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.scenegraph.g2d.snap;
14 import java.awt.geom.Point2D;
16 public class RelativeScaleSnapAdvisor implements ISnapAdvisor {
20 public RelativeScaleSnapAdvisor(double step) {
25 public void snap(Point2D point) {
27 Math.pow(1 + step, Math.round(Math.log(point.getX()) / Math.log(1 + step))),
28 Math.pow(1 + step, Math.round(Math.log(point.getY()) / Math.log(1 + step))));
32 public void snap(Point2D point, Point2D[] features) {