package stk
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=bf3724827aa00f2b5072a9f5e5e9293f
sha512=c7804040165317533b1bbaa6a23374a0bce5ba6976a2f48b49c90aa43c510b03134a1b2c353485365f4dd0cee8cb72d7fbe7558ee52e758db886771e262262d8
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.