> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/gum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flatredball.com/gum/gum-tool/gum-elements/polygon/height-and-width.md).

# Height and Width

## Introduction

`Polygons` can be any shape, so their width and height values cannot be explicitly set. Instead, a `Polygon's` width and height values are determined by their points.

## Width and Height from Points

A `Polygon's` effective width and height is determined by its points. The furthest-right point determines the polygon's width and the furthest down point determines the polygon's height.

For example, a square `Polygon` with the furthest points at 128,128 has a width of 128 and a height of 128.

<figure><img src="/files/4UWJFo8dCRJxnpsuxSxE" alt=""><figcaption></figcaption></figure>

A `Polygon's` height can be used to affect parents, siblings, and children depending on the other instances' `Width Units`, `Height Units`, and stacking values.

For example, we can add a rectangle as a child of a `ColoredRectangle` to see how its points affect the size of the polygon.

<figure><img src="/files/d48F0b7GFOBLOsCxs50T" alt=""><figcaption><p>Polygons in a ColoredRectangle. The ColoredRectangle sizes itself according to the Polygon's width and height</p></figcaption></figure>

We can see similar behavior if we place the Polygon in a stacking parent.

<figure><img src="/files/bSvsn8aBmWBmiInYsXSx" alt=""><figcaption></figcaption></figure>

A `Polygon's` height and width are measured from a `Polygon's` top left corner to the furthest down right point. Points which have a negative value do not affect a `Polygon's` effective height, so moving points above or to the left of the origin will not affect the layout of any object which depends on the `Polygon's` size.

For example, if we move `Polygon` points in a stack up or to the left, this does not shift any of the Polygon's siblings.

<figure><img src="/files/kdEgJzHCPsjzNxwXAWW6" alt=""><figcaption><p>Moving points so they have negative values does not affect the effective size of a Polygon</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flatredball.com/gum/gum-tool/gum-elements/polygon/height-and-width.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
