debug

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT, Unlicense Imports: 22 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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