@@ -168,33 +168,49 @@ thin.core.Line.prototype.getCoordinate = function() {
168168} ;
169169
170170
171+ /**
172+ * @param {number } left
173+ * @private
174+ */
175+ thin . core . Line . prototype . setLeft_ = function ( left ) {
176+ this . left_ = thin . numberWithPrecision ( left - this . getParentTransLateX ( ) ) ;
177+ } ;
178+
179+
171180/**
172181 * @param {number } left
173182 */
174183thin . core . Line . prototype . setLeft = function ( left ) {
175- left = thin . numberWithPrecision ( left - this . getParentTransLateX ( ) ) ;
176- this . left_ = left ;
177- this . setX1 ( left ) ;
178- this . setX2 ( left + this . getWidth ( ) ) ;
184+ this . setLeft_ ( left ) ;
185+ this . setX1 ( this . left_ ) ;
186+ this . setX2 ( this . left_ + this . getWidth ( ) ) ;
187+ } ;
188+
189+
190+ /**
191+ * @param {number } top
192+ * @private
193+ */
194+ thin . core . Line . prototype . setTop_ = function ( top ) {
195+ this . top_ = thin . numberWithPrecision ( top - this . getParentTransLateY ( ) ) ;
179196} ;
180197
181198
182199/**
183200 * @param {number } top
184201 */
185202thin . core . Line . prototype . setTop = function ( top ) {
186- top = thin . numberWithPrecision ( top - this . getParentTransLateY ( ) ) ;
187- this . top_ = top ;
203+ this . setTop_ ( top ) ;
188204
189205 var directionType = thin . core . Line . DIRECTION_ ;
190206 var direction = this . getDirection ( ) ;
191207
192208 if ( direction == directionType . Y1 ) {
193- var y1 = top ;
194- var y2 = top + this . getHeight ( ) ;
209+ var y1 = this . top_ ;
210+ var y2 = this . top_ + this . getHeight ( ) ;
195211 } else if ( direction == directionType . Y2 ) {
196- var y1 = top + this . getHeight ( ) ;
197- var y2 = top ;
212+ var y1 = this . top_ + this . getHeight ( ) ;
213+ var y2 = this . top_ ;
198214 }
199215 this . setY1 ( y1 ) ;
200216 this . setY2 ( y2 ) ;
@@ -203,19 +219,37 @@ thin.core.Line.prototype.setTop = function(top) {
203219
204220/**
205221 * @param {number } width
222+ * @private
206223 */
207- thin . core . Line . prototype . setWidth = function ( width ) {
224+ thin . core . Line . prototype . setWidth_ = function ( width ) {
208225 width = thin . numberWithPrecision ( width ) ;
209226 this . width_ = width ;
210- this . setX2 ( this . getLeft ( ) + width ) ;
227+ } ;
228+
229+
230+ /**
231+ * @param {number } width
232+ */
233+ thin . core . Line . prototype . setWidth = function ( width ) {
234+ this . setWidth_ ( width ) ;
235+ this . setX2 ( this . getLeft ( ) + this . width_ ) ;
236+ } ;
237+
238+
239+ /**
240+ * @param {number } height
241+ * @private
242+ */
243+ thin . core . Line . prototype . setHeight_ = function ( height ) {
244+ this . height_ = thin . numberWithPrecision ( height ) ;
211245} ;
212246
213247
214248/**
215249 * @param {number } height
216250 */
217251thin . core . Line . prototype . setHeight = function ( height ) {
218- this . height_ = thin . numberWithPrecision ( height ) ;
252+ this . setHeight_ ( height ) ;
219253 this . setTop ( this . getTop ( ) ) ;
220254} ;
221255
0 commit comments