-
Notifications
You must be signed in to change notification settings - Fork 46
Fixed broken line rendering in list #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -379,10 +379,10 @@ thin.core.LineShape.prototype.update = function(attrs) { | |
|
|
||
| this.calculateDirection(y1, y2); | ||
|
|
||
| this.setLeft(Math.min(x1, x2) + this.getParentTransLateX()); | ||
| this.setTop(Math.min(y1, y2) + this.getParentTransLateY()); | ||
| this.setWidth(Math.abs(x1 - x2)); | ||
| this.setHeight(Math.abs(y1 - y2)); | ||
| this.setLeft_(Math.min(x1, x2) + this.getParentTransLateX()); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. プライベートメソッドは極力使いたくないし、理由がわからん。インスタンス変数だけ更新したいということだろうけど。
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 最初は インスタンス変数だけ更新しようとしていました。けれども、そもそもの setter の役割が果たせていない気がして private メソッドに分割したのです。
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. まあ、今回のところはいいでしょう。コメントは書いておきたいけど、1.0 で改善するしいいかな。 |
||
| this.setTop_(Math.min(y1, y2) + this.getParentTransLateY()); | ||
| this.setWidth_(Math.abs(x1 - x2)); | ||
| this.setHeight_(Math.abs(y1 - y2)); | ||
| } | ||
|
|
||
| }; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.getLeft()じゃなくてthis.left_で良いのでは。他の箇所もthis.top_ってやってるし、メソッドじゃなくて変数を直接取得する方に統一した方が良さそう。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getter での呼び出しは translate 値を考慮した値を返すという意味があるのです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
なるほど難しい。