Skip to content

Debugging Graphically

wodeni edited this page Oct 23, 2020 · 3 revisions

The graphical debugging view is composed of "layers" that can be toggled on/off.

Layers

polygon

Adds polyline traces and control points to curve path objects.

bbox

Adds bounding boxes around each shape.

Adding Layers

Layers can be found in penrose-web/src/layers. Each layer implements the ILayerProps interface. They are indexed in the layerMap file, mapped as a dict between the layer name and its component class.

To enable a new layer as a toggle-able button, simply add it to the layers array in the state of penrose-web/src/App.tsx, following the ILayer interface. You probably want enabled to be false by default. This follows for the IDE's inspector as well: add the desired layers to the layers array in the state of App.tsx. Layers are rendered in sequential order from the array, so layers towards the end will be rendered on top.

Clone this wiki locally