Permalink
Browse files

Merge branch 'master' of github.com:maccman/stylo

  • Loading branch information...
alex-stripe committed Nov 19, 2012
2 parents e7657b9 + b6afc37 commit 71aecf096e4ebad05404d5a659e2ac9caae94f75
View
@@ -2,7 +2,9 @@
Stylo is a web app designer written in [CoffeeScript](http://coffeescript.org) and [Spine](http://spinejs.com). It allows you to manipulate various HTML elements, add styles and edit text.
-![Stylo](http://img.svbtle.com/maccman-24077671832628-raw.png)
+You can find a [demo here](http://styloapp.com/) *(webkit only)*.
+
+[![Stylo](http://img.svbtle.com/maccman-24077671832628-raw.png)](http://styloapp.com/)
## Code examples
@@ -16,4 +18,4 @@ The code should provide good examples of how to achieve the following:
## More
-For more information, please see the [blog post](http://blog.alexmaccaw.com/).
+For more information, please see the [blog post](http://blog.alexmaccaw.com/stylo).
@@ -151,8 +151,8 @@ class Stage extends Spine.Controller
center: ->
area = @area()
position =
- left: area.width / 2
- top: area.height / 2
+ left: Math.floor(area.width / 2)
+ top: Math.floor(area.height / 2)
# Properties
@@ -84,8 +84,8 @@ class VerticalCenterSnap extends Snap
type: 'vertical'
snapIn: (area, difference) ->
- left = area.left + (area.width / 2)
- middle = @stage.area().width / 2
+ left = Math.floor(area.left + (area.width / 2))
+ middle = Math.floor(@stage.area().width / 2)
# Vertical center of stage
if @withinThreshold(left - middle)
@@ -98,8 +98,8 @@ class HorizontalCenterSnap extends Snap
type: 'horizontal'
snapIn: (area, difference) ->
- top = area.top + (area.height / 2)
- middle = @stage.area().height / 2
+ top = Math.floor(area.top + (area.height / 2))
+ middle = Math.floor(@stage.area().height / 2)
# Horizontal center of stage
if @withinThreshold(top - middle)
@@ -159,7 +159,7 @@ class HorizontalElementSnap extends Snap
for area, i in areas
areas[i] =
top: area.top
- middle: area.top + area.height / 2
+ middle: Math.floor(area.top + area.height / 2)
bottom: area.top + area.height
current = areas.shift()
@@ -193,7 +193,7 @@ class VerticalElementSnap extends Snap
for area, i in areas
areas[i] =
left: area.left
- middle: area.left + area.width / 2
+ middle: Math.floor(area.left + area.width / 2)
right: area.left + area.width
current = areas.shift()

0 comments on commit 71aecf0

Please sign in to comment.