Skip to content

Commit

Permalink
Got rotation playing nicely with new scale behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
tantaman committed Jun 19, 2012
1 parent 00c1712 commit 544111f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion client/src/ui/editor/components/ComponentView.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ define(["vendor/backbone",
"css!../res/css/ComponentView.css"],
(Backbone, DeltaDragControl, Templates, empty) ->
Backbone.View.extend(
transforms: ["skewX", "skewY", "rotate"]
transforms: ["skewX", "skewY"]
className: "component"
# TODO: make this junk less verbose
# and more common
Expand Down Expand Up @@ -125,6 +125,7 @@ define(["vendor/backbone",
height: newHeight)

@$contentScale.css(window.browserPrefix + "transform", "scale(" + scale + ")")
@$el.css(window.browserPrefix + "transform", "rotate(" + @model.get("rotate") + "rad)")


# TODO: just use the transform matrix...
Expand Down
5 changes: 3 additions & 2 deletions client/web/scripts/ui/editor/components/ComponentView.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions client/web/scripts/ui/editor/res/css/ComponentView.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
-moz-transform-origin: 0 0;
}

.component .content {
-webkit-transform-origin: 50% 50%;
-moz-transform-origin: 50% 50%;
transform-origin: 50% 50%;
}

.component.selected .label {
visibility: visible;
}
Expand Down

0 comments on commit 544111f

Please sign in to comment.