vAlign

Aligns drawing elements y axis position to a given rectangle.

Parameters

elements Array

An array with the drawing elements that should be aligned.

rect kendo.geometry.Rect

The rectangle in which the elements should be aligned.

alignment String

Specifies how should the elements be aligned. The supported values are:

  • "start" - the elements will be aligned to the rectangle origin.
  • "center" - the elements will be aligned to the rectangle center.
  • "end" - the elements will be aligned to the bottom side of the rectangle.

Example

<div id="surface" style="height: 300px;"></div>
<script>
  var draw = kendo.drawing;
  var Rect = kendo.geometry.Rect;
  var rect = new Rect([0, 0], [100, 300]);
  var path = draw.Path.fromRect(new Rect([0, 0], [100, 100]));

  draw.vAlign([path], rect, "center");

  var surface = draw.Surface.create($("#surface"));
  surface.draw(path);
  surface.draw(draw.Path.fromRect(rect));
</script>
In this article