Skip to content
Permalink
Browse files

Add centeredFrame function

  • Loading branch information
Koen Bok
Koen Bok committed May 3, 2013
1 parent 5b23d4e commit 3ad0dc0ee7ad09b38261364f24c71a134c043d86
Showing with 24 additions and 30 deletions.
  1. +9 −13 build/framer.js
  2. +6 −4 src/views/view.coffee
  3. +9 −13 template/framer.js
@@ -1,7 +1,7 @@
// Framer v2.0.0b1-33-gc02eef3 (c) 2013 Koen Bok
// Framer v2.0.0b1-35-g5b23d4e (c) 2013 Koen Bok
// https://github.com/koenbok/Framer

window.FramerVersion = "v2.0.0b1-33-gc02eef3";
window.FramerVersion = "v2.0.0b1-35-g5b23d4e";


(function(){var require = function (file, cwd) {
@@ -2403,21 +2403,17 @@ require.define("/src/views/view.coffee",function(require,module,exports,__dirnam
});
};

View.prototype.centerX = function() {
View.prototype.centeredFrame = function() {
var frame;

frame = this.frame;
if (this.superView) {
return this.midX = this.superView.width / 2.0;
frame.midX = this.superView.width / 2.0;
}
};

View.prototype.centerY = function() {
if (this.superView) {
return this.midY = this.superView.height / 2.0;
frame.midY = this.superView.height / 2.0;
}
};

View.prototype.center = function() {
this.centerX();
return this.centerY();
return frame;
};

View.define("width", {
@@ -104,10 +104,12 @@ class View extends Frame
width: maxX - minX
height: maxY - minY


centerX: -> @midX = @superView.width / 2.0 if @superView
centerY: -> @midY = @superView.height / 2.0 if @superView
center: -> @centerX(); @centerY()
centeredFrame: ->
# Get the centered frame for it's superview
frame = @frame
frame.midX = @superView.width / 2.0 if @superView
frame.midY = @superView.height / 2.0 if @superView
frame

#############################################################################
## Geometry
@@ -1,7 +1,7 @@
// Framer v2.0.0b1-33-gc02eef3 (c) 2013 Koen Bok
// Framer v2.0.0b1-35-g5b23d4e (c) 2013 Koen Bok
// https://github.com/koenbok/Framer

window.FramerVersion = "v2.0.0b1-33-gc02eef3";
window.FramerVersion = "v2.0.0b1-35-g5b23d4e";


(function(){var require = function (file, cwd) {
@@ -2403,21 +2403,17 @@ require.define("/src/views/view.coffee",function(require,module,exports,__dirnam
});
};

View.prototype.centerX = function() {
View.prototype.centeredFrame = function() {
var frame;

frame = this.frame;
if (this.superView) {
return this.midX = this.superView.width / 2.0;
frame.midX = this.superView.width / 2.0;
}
};

View.prototype.centerY = function() {
if (this.superView) {
return this.midY = this.superView.height / 2.0;
frame.midY = this.superView.height / 2.0;
}
};

View.prototype.center = function() {
this.centerX();
return this.centerY();
return frame;
};

View.define("width", {

0 comments on commit 3ad0dc0

Please sign in to comment.
You can’t perform that action at this time.