relative-coordinate-clamping

Clamp child coordinates to parent space in hierarchical rendering pipelines.

1|Updated Feb 15, 2026
One-click install
npx skills add https://github.com/mlinnen/mr-pumpkin --skill relative-coordinate-clamping
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: relative-coordinate-clamping
Source: https://github.com/mlinnen/mr-pumpkin/tree/main/.squad/skills/relative-coordinate-clamping
Command: npx skills add https://github.com/mlinnen/mr-pumpkin --skill relative-coordinate-clamping

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

In graphics rendering, when a parent element is transformed, child elements can go out of view or clip incorrectly if clamping is done in absolute screen coordinates. This skill provides a pattern to clamp coordinates relative to the parent's coordinate system, ensuring consistent behavior across transforms.

Core Features & Use Cases

  • Relative positioning of children to transformed parents to preserve layout during offsets, scales, and rotations.
  • Clamp against true boundaries (parent bounds and screen edges) rather than hardcoded screen coordinates.
  • Relative collision detection and bounds checks to maintain visibility without snapping.
  • Avoid anti-patterns such as clamping before transform or using fixed screen coordinates.

Quick Start

Apply this pattern by calculating child positions relative to their parent and clamp against actual rendering boundaries to preserve visibility when the parent is transformed.

Frequently Asked Questions about relative-coordinate-clamping

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent child UI elements from clipping when the parent is scaled or offset?

Clamp child coordinates to the parent's coordinate system instead of absolute screen values. This relative clamping ensures child UI elements preserve their layout and visibility during hierarchical transforms like offset, scale, and rotation.

Why does clamping graphics rendering positions before transform cause incorrect clipping?

Clamping before transform uses hardcoded screen coordinates that become invalid once the parent moves. You must compute transforms from world to parent space first, positioning children relative to the parent to maintain accurate boundary clamping.

What is the best way to clamp coordinates for hierarchical layout transforms during animation?

The best way to clamp coordinates for hierarchical layout transforms is calculating child positions relative to the parent and clamping against actual rendering boundaries, which prevents snapping and maintains visibility across composed offsets, scales, and rotations.

How do I apply boundary clamping against actual rendering boundaries instead of fixed screen edges?

Apply boundary clamping by computing transforms from world to parent space, then checking child bounds against both parent bounds and screen edges. This avoids anti-patterns of using fixed screen coordinates during graphics rendering.

Does relative coordinate clamping work with character limbs during animation rotation?

Yes, relative coordinate clamping works for character limbs during animation rotation. It applies in hierarchical rendering pipelines where multiple transforms are composed, ensuring limb positions remain bound to parent transforms without clipping.