MCPcopy Create free account
hub / github.com/cogentcore/core / PointToRelPos

Method PointToRelPos

core/render.go:423–425  ·  view source on GitHub ↗

Widget position functions PointToRelPos translates a point in Scene pixel coords into relative position within node, based on the Content BBox

(pt image.Point)

Source from the content-addressed store, hash-verified

421// PointToRelPos translates a point in Scene pixel coords
422// into relative position within node, based on the Content BBox
423func (wb *WidgetBase) PointToRelPos(pt image.Point) image.Point {
424 return pt.Sub(wb.Geom.ContentBBox.Min)
425}
426
427// winBBox returns the RenderWindow based bounding box for the widget
428// by adding the Scene position to the ScBBox

Callers 7

InitMethod · 0.80
pixelToCursorMethod · 0.80
mousePosInGridMethod · 0.80
indexFromPixelMethod · 0.80
InitMethod · 0.80
handleMouseMethod · 0.80
handleLinkCursorMethod · 0.80

Calls 1

SubMethod · 0.45

Tested by

no test coverage detected