Guide

Vecta.Guide

new Vecta.Guide([obj], orient)

Vecta Guide object.

NameTypeAttributesDescription
objstring|objectoptional

A valid string or a node, JQ or v object.

orientboolean

horizontal line if is false, vertical line if is true

Methods

.delete()

Delete a guide from the page.

.id() Returns: string

Get the guide id. Read only.

Returns:

Returns the guide ID.

.move([x], [y]) Returns: Object|Vecta.Guide

Get or set position of guide.

For get operations, both x and y must be undefined or not provided. If any one of the parameters is provided, then it is considered a set operation.

For set operations, if either x or y is not provided, then the current value is used in replacement. Both x and y can be numbers (px) or valid length strings, eg: 1in, 1 mm, 10 px.

If any of the provided parameters is an invalid length, then the operation fails with an error message in console.

NameTypeAttributesDescription
xnumber|stringoptional

X coordinate of guide.

ynumber|stringoptional

Y coordinate of guide.

Returns:

Returns the x and y coordinates if get or Vecta.Guide if set.

For get operations, the returned object will be in the following format:

{x: number|string, y: number|string}

where the type for x and y coordinates may be in numbers (px) or valid length strings.

Examples:
var guide = new Vecta.Guide('#123');
guide.move(0, 10); //move the horizontal guide to 10px
console.log(guide.move()); //{x: 0, y: 10}