Skip to content

class Selection public ​

A utility to help coordinate selections. Currently used for text selection and in Hokusai::Blocks::Selectable

#cursor=(arr) public ​

Set the current cursor position

Arguments ​

  • arr - an array of 4 floats (start_x, stop_x, cursor_width, cursor_height)

Returns ​

Returns nothing

#offset_y public ​

Returns the selection y offset

Returns ​

Returns a float

#geom? public ​

Is the selection in geometry mode?

Returns ​

Returns boolean

#geom!(clear) public ​

Use geometry mode

Arguments ​

  • clear - (boolean) should the positions be cleared? (default true)

Returns ​

Returns nothing

#pos? public ​

Is the selection in positional mode?

Returns ​

Returns boolean

#pos!(clear) public ​

Use positional mode

Arguments ​

  • clear - (boolean) should the geometry be cleared? (default false)

Returns ​

Returns nothing

#clear public ​

Clear all selections and start in geometry mode.

Returns ​

Returns nothing

#selecting? public ​

Are we actively selecting?

Returns ​

Returns boolean

#cursor=(arr) public ​

Set the current cursor position

Arguments ​

  • arr - an array of 4 floats (start_x, stop_x, cursor_width, cursor_height)

Returns ​

Returns nothing

#offset_y public ​

Returns the selection y offset

Returns ​

Returns a float

#geom? public ​

Is the selection in geometry mode?

Returns ​

Returns boolean

#geom!(clear) public ​

Use geometry mode

Arguments ​

  • clear - (boolean) should the positions be cleared? (default true)

Returns ​

Returns nothing

#pos? public ​

Is the selection in positional mode?

Returns ​

Returns boolean

#pos!(clear) public ​

Use positional mode

Arguments ​

  • clear - (boolean) should the geometry be cleared? (default false)

Returns ​

Returns nothing

#clear public ​

Clear all selections and start in geometry mode.

Returns ​

Returns nothing

#selecting? public ​

Are we actively selecting?

Returns ​

Returns boolean