<199802181014.TAA19516 / picachu.netlab.co.jp> の、 "[ruby-dev:1487] Re: tkmandel" において、 "matz / netlab.co.jp (Yukihiro Matsumoto)"さんは書きました: > |なんとか動くようになったみたいなので……。見てやってください。 > > おおー,すごい. 単純なのに、きれいですよね。 ズーム機能のバグ修正と手直し(ゆっくり深まるように)です: M.Kanemitsu @@ -73,9 +73,10 @@ center_x = (a + c) / 2 center_y = (b + d) / 2 size = (c - a).abs - size = (d - a).abs if (size < (d - a).abs) + size = (d - b).abs if (size < (d - b).abs) zoom_rate = ((Width + Height) / 2).to_f / size - $max_deapth = ($max_deapth.to_f * Math.sqrt(zoom_rate)).to_i + $max_deapth = ($max_deapth.to_f * + Math.sqrt(Math.sqrt(zoom_rate))).to_i move_x_rate = (center_x - (Width / 2)).to_f / (Width / 2) move_y_rate = (center_y - (Height / 2)).to_f / (Height / 2)