Skip to content

Commit

Permalink
Connector circles are now all displayed on project open
Browse files Browse the repository at this point in the history
  • Loading branch information
Tino Schmidt committed Sep 14, 2018
1 parent 844f533 commit cbf6b12
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ public class Connector extends Treeline implements TreeEventListener{

//actyc: variable to store connected Treelines explicitly
protected HashSet<Treeline> conTreelines = new HashSet<Treeline>();

private final int MIN_RADIUS = 10;

public Connector(final Project project, final String title) {
super(project, title);
Expand Down Expand Up @@ -451,7 +453,7 @@ public void mousePressed(final MouseEvent me, final Layer layer, final int x_p,
if (ProjectToolbar.PEN == ProjectToolbar.getToolId()) {

if (-1 == last_radius) {
last_radius = 10 / (float)mag;
last_radius = MIN_RADIUS / (float)mag;
}

if (null != root) {
Expand Down Expand Up @@ -596,6 +598,11 @@ public boolean sanityCheck() {
* @return
*/
public boolean sanityCheck( boolean headless){

float mag = null != Display.getFront() ? (float) Display.getFront().getCanvas().getMagnification() : 1f;

if (-1 == last_radius) last_radius = MIN_RADIUS / mag;

if(!conTreelines.isEmpty()){
if(root!=null && root.hasChildren()){
ArrayList<Node<Float>> targets = new ArrayList<Node<Float>>();
Expand Down

0 comments on commit cbf6b12

Please sign in to comment.