Skip to content

Commit

Permalink
Fixed bugs: First, fixed layout: made it so that wrap will never shri…
Browse files Browse the repository at this point in the history
…nk, only grow. Second, made it so that ctrl_r will still refresh the page.
  • Loading branch information
jbeard4 committed Apr 1, 2011
1 parent a35e627 commit c853f23
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
12 changes: 8 additions & 4 deletions behaviour/constructors/drop-targetable.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,19 @@ define(["c","helpers","behaviour/constructors/highlightable"],
cm.Constraint(
cm.NodeAttr(this,"width"),
[cm.NodeAttrExpr(this,"x"),
cm.NodeAttrExpr(this,["x","width"],cm.sum),
cm.NodeAttrExpr(shape,["x","width"],cm.sum)],
function(classContainerRectX){
function(classContainerRectX,classContainerRectRightX){
//TODO: read arbitrary arguments for second parameter

var args = Array.prototype.slice.call(arguments);
args = args.slice(1);
args = args.slice(2);
/*jsl:ignore*/
var rightXArgs = args.map(function(shapeRightX){return shapeRightX - classContainerRectX});
/*jsl:end*/
var rightX = Math.max.apply(this,rightXArgs);
var rightXPlusPadding = rightX + spacing.rightPadding;
rightXPlusPadding = Math.max(rightXPlusPadding,classContainerRectRightX - classContainerRectX);
return rightXPlusPadding >= spacing.minWidth ? rightXPlusPadding : spacing.minWidth;
}
);
Expand All @@ -118,16 +120,18 @@ define(["c","helpers","behaviour/constructors/highlightable"],
cm.Constraint(
cm.NodeAttr(this,"height"),
[cm.NodeAttrExpr(this,"y"),
cm.NodeAttrExpr(this,["y","height"],cm.sum),
cm.NodeAttrExpr(shape,["y","height"],cm.sum)],
function(classContainerRectY,shapeBottomY){
function(classContainerRectY,classContainerRectBottomY){
//TODO: read arbitrary arguments for second parameter
var args = Array.prototype.slice.call(arguments);
args = args.slice(1);
args = args.slice(2);
/*jsl:ignore*/
var bottomYArgs = args.map(function(shapeBottomY){return shapeBottomY - classContainerRectY});
/*jsl:end*/
var bottomY = Math.max.apply(this,bottomYArgs);
var bottomYPlusPadding = bottomY + spacing.leftPadding;
bottomYPlusPadding = Math.max(bottomYPlusPadding, classContainerRectBottomY - classContainerRectY);

return bottomYPlusPadding >= spacing.minHeight ? bottomYPlusPadding : spacing.minHeight ;
}
Expand Down
5 changes: 4 additions & 1 deletion init.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ function init(evt) {
scEvent = "ctrl_" + scEvent;
}

e.preventDefault();
//we don't want to override ctrl+r... probably others as well
if(scEvent !== "ctrl_r"){
e.preventDefault();
}

compiledStatechartInstance.GEN(scEvent,({domEvent:e,currentTarget:svgRoot}));
},false);
Expand Down

0 comments on commit c853f23

Please sign in to comment.