Permalink
Browse files

zoom 기능 적용 완료

  • Loading branch information...
1 parent dcec94d commit cd1f11cc07d0cd4562c12733126aaa823bd7be00 @chorr chorr committed Feb 26, 2012
Showing with 6 additions and 18 deletions.
  1. +6 −18 static/dot.app.js
View
@@ -42,14 +42,11 @@ dot.App = {
this.$canvas = $(".canvas");
dot.App.canvas = this.canvas = new dot.CanvasView({ target: this.$canvas }).model;
- new dot.UI.Slider({
+ this.slider = new dot.UI.Slider({
target: $(".item-slider"),
- handler: {
- move: _.bind(this.scale, this),
- minus: _.bind(this.zoomOut, this),
- plus: _.bind(this.zoomIn, this)
- }
- });
+ max: 10,
+ value: 5
+ }).on("change", $.proxy(this.scale, this));
this.scrollTop();
$(window).bind("orientationchange", this.scrollTop);
@@ -80,18 +77,9 @@ dot.App = {
this.canvas.clearPixel();
},
- scale: function(val) {
- this.canvas.scale(val);
- },
-
- zoomOut: function() {
- this.canvas.scale(-3);
- },
-
- zoomIn: function() {
- this.canvas.scale(3);
+ scale: function(val, diff) {
+ this.canvas.scale(diff);
}
-
})
};

0 comments on commit cd1f11c

Please sign in to comment.