Baseline

com.alecdorrington.laminarcomponents.Baseline
object Baseline

Where an element's text stands on its baseline. Fonts differ by platform and script, so the baseline is measured rather than assumed, as to draw a rule beneath each line of text.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Baseline.type

Members list

Value members

Concrete methods

def of(element: HTMLElement): Double

Measures how far below a line's top an element's text stands on its baseline, in its font, size and line height, which a hidden, empty inline block shows by standing on it. The block is laid beside the element, so that it serves a field too.

Measures how far below a line's top an element's text stands on its baseline, in its font, size and line height, which a hidden, empty inline block shows by standing on it. The block is laid beside the element, so that it serves a field too.

Value parameters

element

The element, laid out on the page.

Attributes

Returns

The distance, in pixels, or 0 for an element laid out nowhere.

def snapped(at: Double): Double

Moves an offset on the screen onto the nearest device pixel.

Moves an offset on the screen onto the nearest device pixel.

Value parameters

at

The offset, in CSS pixels.

Attributes

Returns

The offset moved.