align(3U)
β¨ align(3U) β InterViews Reference Manual β¨
okay bestie, buckle up, we're talking about align(3U) from the InterViews Reference Manual π this one's all about the Unidraw command girls who make your interactors line up all cute and tidy. no cap.
πΈ NAME πΈ
AlignCmd, AlignToGridCmd β commands for aligning interactors to each other and to a grid. literally the matchmaker of layout, fr fr π
π¦ SYNOPSIS π¦
#include <Unidraw/Commands/align.h>
π DESCRIPTION π
so AlignCmd is a purely interpretive command for aligning selected components with respect to one another. like, it can align the left sides of selected components so that they coincide. iconic behavior honestly β¨
AlignToGridCmd is a whole different vibe β it gets interpreted by selected GraphicView objects so they align themselves to the grid (if any) associated with the viewer in which they appear. so each component gets to define what it means to align itself to the grid. main character energy, each one deciding for themselves π«Ά
π ALIGNCMD PUBLIC OPERATIONS π
AlignCmd(
ControlInfo*,
Alignment reference = Left, Alignment affected = Left
)
AlignCmd(Editor* = nil, Alignment = Left, Alignment = Left)β the constructor, and she takes optional arguments for specifying the alignment you want. thereferenceparameter specifies a point on a fixed reference component. theaffectedparameter specifies a point on components that will move to realize the alignment. and the defaults for these parameters? they specify that all affected components should align their left sides to reference's left side. left gang rise up πvoid GetAlignment(Alignment&, Alignment&)β returns the alignment parameters that were specified in the constructor. lowkey just handing your settings back to you, no notes.GraphicComp* GetReference(GraphicComp* affected)β returns the reference component given a potentially affected component. here's the tea: ifaffectedappears in theAlignCmd's clipboard, thenGetReferencereturns theGraphicComppreceding it in the clipboard. but ifaffectedis the first component in the clipboard, or if it's not on the clipboard at all, thenGetReferencereturns the first component on the clipboard. first place stays winning π
π ALIGNTOGRIDCMD PUBLIC OPERATIONS π
AlignToGridCmd(ControlInfo*)
AlignToGridCmd(Editor* = nil)
AlignToGridCmd(ControlInfo*)andAlignToGridCmd(Editor* = nil)β construct anAlignToGridCmd. that's it, that's the job, she's built πvirtual void Execute()andvirtual void Unexecute()βAlignToGridCmdredefinesExecuteto let the selectedGraphicViewobjects interpret the command the first time. this lets the components determine the proper grid with which to align themselves, plus the amount of movement required.Executeassumes thatGraphicViewobjects will use theAlignoperation (described below) to compute the amount of movement, store it in aMoveDataobject, and finally issue aMoveCmdto the subject for interpretation. andUnexecute? she simply callsUnmove(also described below) to reverse theAlign's effects. undoing the undoing, as one does πvirtual void Align(GraphicView*, float, float)andvirtual void Unalign(GraphicView*)βGraphicViewobjects interpreting theAlignToGridCmdshould use theAlignoperation to specify a point to align to the grid that affects them.Alignwill effectively move the component so that the given point falls on the grid. it will also store the amount of movement inthisby callingStorewith aMoveDataobject. finally,AligncallsMove(described below) to actually move the component that amount.Unalignprovides a public interface to reversing the effects ofAlignby simply callingUnmovewith its argument's subject. symmetry, bestie, we love to see it β¨
π§ ALIGNTOGRIDCMD PROTECTED OPERATIONS π§
void Move(GraphicComp*)andvoid Unmove(GraphicComp*)βMoveproduces aMoveCmdbased on theMoveDatastored for the givenGraphicCompand tells theGraphicCompto interpret theMoveCmd. conversely,Unmoveproduces aMoveCmdbased on the the same information and tells theGraphicCompto uninterpret it. yes, "the the" β I'm keeping it, that's canon, don't @ me π
π SEE ALSO π
Command(3U), GraphicComp(3U), GraphicView(3U), Grid(3U), Viewer(3U), datas(3U), transforms(3U)
go read those too, iykyk πΈ
reminder bestie: this page is align(3U) from the InterViews Reference Manual, and it's brought to you by Unidraw, dated 23 January 1991 π like, vintage but make it slay. mwah, that's the whole manual, periodt π
π
π¦ where this page comes from
- debian bookworm: ivtools-dev 2.0.11d.a1-1+b4
- debian trixie: ivtools-dev 2.0.11d.a1-3+b4
- ubuntu jammy: ivtools-dev 2.0.11d.a1-1build1
- ubuntu noble: ivtools-dev 2.0.11d.a1-3build1
- ubuntu questing: ivtools-dev 2.0.11d.a1-3build7
- ubuntu resolute: ivtools-dev 2.0.11d.a1-3build9
- ubuntu stonking: ivtools-dev 2.1.1+git.2025.07.26.a1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms