RectRulers.Companion


Summary

Extension functions

RectRulers

Merges multiple RectRulers into a single RectRulers, using the inner-most value.

Cmn
RectRulers

Merges multiple RectRulers into a single RectRulers, using the outer-most value.

Cmn

Extension functions

innermostOf

fun RectRulers.Companion.innermostOf(vararg rulers: RectRulers): RectRulers

Merges multiple RectRulers into a single RectRulers, using the inner-most value. That is, the RectRulers.left will be the greatest RectRulers.left, the RectRulers.top will be the greatest RectRulers.top, the RectRulers.right will be the least RectRulers.right, and the RectRulers.bottom will be the least of all rulers.

When rulers provide non-overlapping values, the result may have negative size. For example, if one RectRulers provides (10, 20, 30, 40) as their ruler values, and another provides (1, 1, 5, 5), the merged result will be (10, 20, 5, 5).

If one of the rulers does not provide a value, it will not be considered in the calculation.

outermostOf

fun RectRulers.Companion.outermostOf(vararg rulers: RectRulers): RectRulers

Merges multiple RectRulers into a single RectRulers, using the outer-most value. That is, the RectRulers.left will be the least RectRulers.left, the RectRulers.top will be the least RectRulers.top, the RectRulers.right will be the greatest RectRulers.right, and the RectRulers.bottom will be the greatest of all rulers.

If one of the rulers does not provide a value, it will not be considered in the calculation.