javascript/mxClient.js
function snapY(y, state)
		{
			y += this.graph.panDy;
			var override = false;
			
			if (Math.abs(y - middle) < ttY)
			{
				dy = y - bounds.getCenterY();
				ttY = Math.abs(y -  middle);
				override = true;
			}
			else if (Math.abs(y - top) < ttY)
			{
				dy = y - bounds.y;
				ttY = Math.abs(y - top);
				override = true;
			}
			else if (Math.abs(y - bottom) < ttY)
			{
				dy = y - bounds.y - bounds.height;
				ttY = Math.abs(y - bottom);
				override = true;
			}
			
			if (override)
			{
				stateY = state;
				valueY = Math.round(y - this.graph.panDy);
				
				if (this.guideY == null)
				{
					this.guideY = this.createGuideShape(false);
					
					// Makes sure to use either VML or SVG shapes in order to implement
					// event-transparency on the background area of the rectangle since
					// HTML shapes do not let mouseevents through even when transparent
					this.guideY.dialect = (this.graph.dialect != mxConstants.DIALECT_SVG) ?
						mxConstants.DIALECT_VML : mxConstants.DIALECT_SVG;
					this.guideY.pointerEvents = false;
					this.guideY.init(this.graph.getView().getOverlayPane());
				}
			}
			
			overrideY = overrideY || override;
		}
function snapY(y, state)
		{
			y += this.graph.panDy;
			var override = false;
			
			if (Math.abs(y - middle) < ttY)
			{
				dy = y - bounds.getCenterY();
				ttY = Math.abs(y -  middle);
				override = true;
			}
			else if (Math.abs(y - top) < ttY)
			{
				dy = y - bounds.y;
				ttY = Math.abs(y - top);
				override = true;
			}
			else if (Math.abs(y - bottom) < ttY)
			{
				dy = y - bounds.y - bounds.height;
				ttY = Math.abs(y - bottom);
				override = true;
			}
			
			if (override)
			{
				stateY = state;
				valueY = Math.round(y - this.graph.panDy);
				
				if (this.guideY == null)
				{
					this.guideY = this.createGuideShape(false);
					
					// Makes sure to use either VML or SVG shapes in order to implement
					// event-transparency on the background area of the rectangle since
					// HTML shapes do not let mouseevents through even when transparent
					this.guideY.dialect = (this.graph.dialect != mxConstants.DIALECT_SVG) ?
						mxConstants.DIALECT_VML : mxConstants.DIALECT_SVG;
					this.guideY.pointerEvents = false;
					this.guideY.init(this.graph.getView().getOverlayPane());
				}
			}
			
			overrideY = overrideY || override;
		}
function snapY ( y , state ) { y += this . graph . panDy ; var override = false ; if ( Math . abs ( y - middle ) < ttY ) { dy = y - bounds . getCenterY ( ) ; ttY = Math . abs ( y - middle ) ; override = true ; } else if ( Math . abs ( y - top ) < ttY ) { dy = y - bounds . y ; ttY = Math . abs ( y - top ) ; override = true ; } else if ( Math . abs ( y - bottom ) < ttY ) { dy = y - bounds . y - bounds . height ; ttY = Math . abs ( y - bottom ) ; override = true ; } if ( override ) { stateY = state ; valueY = Math . round ( y - this . graph . panDy ) ; if ( this . guideY == null ) { this . guideY = this . createGuideShape ( false ) ; // Makes sure to use either VML or SVG shapes in order to implement // event-transparency on the background area of the rectangle since // HTML shapes do not let mouseevents through even when transparent this . guideY . dialect = ( this . graph . dialect != mxConstants . DIALECT_SVG ) ? mxConstants . DIALECT_VML : mxConstants . DIALECT_SVG ; this . guideY . pointerEvents = false ; this . guideY . init ( this . graph . getView ( ) . getOverlayPane ( ) ) ; } } overrideY = overrideY || override ; }
Snaps the top, middle or bottom to the given y-coordinate
Snaps the top middle or bottom to the given y - coordinate