package stk
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=beeed5752ff67b3abeb1bcf8fb6b9098
sha512=c1603ae66956a674864ad875212fdbfc8d8016983202108d492b0d8722106b1e982e9fdc04b20d1b7adf5013343252fc5173851751906271731bc81d70dc789c
doc/stk/Stk/G/index.html
Module Stk.G
Source
Geometry.
This module is used to represent and compute widget coordinates.
A geometry is rectangle. x
and y
are coordinates of top-left corner.
seg_inter x1 w1 x2 w2
returns the intersection segment (left..right) between segments (x1..(x1+w1))
and (x2..(x2+w2))
, if any.
inside ~x ~y g
returns true
is point (x, y)
is inside g
.
translate ~x ~y g
returns a new geometry, adding x
(resp. y
) to g.x
(resp. g.y
) if specified.
enlarge ~w ~h g
returns a new geometry whose width (resp. height) is increased by 2 * w
(resp. 2 * h
). g.x
(resp. g.y
) is translated by -w
(resp. -h
) so that the final geometry remains centered with report to the original one.
to_rect g
creates a Tsdl.Sdl.rect
from g
.
of_rect r
creates a geometry t
from a Tsdl.Sdl.rect
.
has_intersect g1 g2
returns true
if intersection g1 g2 <> None
.
remove_border g borders
returns a new geometry by removing borders from g
. It is ensured that the returned geometry has non-negative width and height.