New to Kendo UI for jQueryStart a free 30-day trial

Align

methods

Aligns drawing elements x axis position to a given rectangle.

Parameters:elementsArray

An array with the drawing elements that should be aligned.

rectkendo.geometry.Rect

The rectangle in which the elements should be aligned.

alignmentString

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 right side of the rectangle.
<div id="surface"></div>
<script>
  var draw = kendo.drawing;
  var Rect = kendo.geometry.Rect;
  var rect = new Rect([200, 0], [300, 100]);
  var path = draw.Path.fromRect(new Rect([0, 0], [100, 100]));

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

  var surface = draw.Surface.create($("#surface"));
  surface.draw(path);
  surface.draw(draw.Path.fromRect(rect));
</script>
Not finding the help you need?
Contact Support