Creating suggestions One of the main features of the app is to give suggestions. When you tap on the screen to create points, suggestions will appear on top. For example, if I created two points the suggestions will contain a circle, semi-circle and a straight line. Suggestions for two points How suggestions are drawn - Java code First, create a rectangle with the points. This is obtained by finding the top left and bottom right points. public static Rect clipRectFrom ( Point ... points) { int topX = Integer .MAX_VALUE, topY = Integer .MAX_VALUE, rightX = 0, rightY = 0; for ( Point point : points) { if (topX > point.x) { topX = point.x; } else if (rightX < point.x) { rightX = point.x; } if (topY > point.y) { topY = point.y; } else if (rightY < point.y) { rightY = point.y; } } ...
Comments
Post a Comment