debug

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2024 License: MIT, Unlicense Imports: 22 Imported by: 0

Documentation

Overview

Package debug provides tools for layout debugging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Layout

func Layout(gtx layout.Context, tag any, w layout.Widget) layout.Dimensions

Layout wraps w with a debug.ConstraintEditor. The state for the constraint editor is stored automatically using the unique tag provided. Note: the state will never be deleted.

func Wrap

func Wrap(tag any, w layout.Widget) layout.Widget

Wrap wraps w with a debug.ConstraintEditor. The state for the constraint editor is stored automatically using the unique tag provided. Note: the state will never be deleted.

Types

type ConstraintEditor

type ConstraintEditor struct {

	// LineWidth is the width of debug overlay lines like those outlining the constraints
	// and widget size.
	LineWidth unit.Dp
	// MinSize is the side length of the smallest the editor is allowed to go. If the editor
	// makes the constraints smaller than this, it will reset itself. If the constraints are
	// already smaller than this, the editor will not display itself.
	MinSize unit.Dp
	// TextSize determines the size of the on-screen contextual help text.
	TextSize unit.Sp

	MinColor, MaxColor, SizeColor, SurfaceColor color.NRGBA
	// contains filtered or unexported fields
}

ConstraintEditor provides controls to edit layout constraints live.

func (*ConstraintEditor) Layout

Layout the constraint editor to debug the layout of w.

func (*ConstraintEditor) Wrap

Wrap returns a new layout function with the ConstraintEditor wrapping the provided widget. This can make inserting the editor more ergonomic than the Layout signature.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL