Blender V5.0
ButAlign Struct Reference

Public Attributes

uiButbut
ButAlignneighbors [4]
std::array< float *, 4 > borders
blender::float4 dists
blender::char4 flags

Detailed Description

This struct stores a (simplified) 2D representation of all buttons of a same align group, with their immediate neighbors (if found), and needed value to compute 'stitching' of aligned buttons.

Note
This simplistic struct cannot fully represent complex layouts where buttons share some 'align space' with several others (see schema below), we'd need linked list and more complex code to handle that. However, looks like we can do without that for now, which is rather lucky!
      +--------+-------+
      | BUT 1  | BUT 2 |      BUT 3 has two 'top' neighbors...
      |----------------|  =>  In practice, we only store one of BUT 1 or 2 (which ones is not
      |      BUT 3     |      really deterministic), and assume the other stores a ref to BUT 3.
      +----------------+
      

This will probably not work in all possible cases, but not sure we want to support such exotic cases anyway.

Definition at line 43 of file interface_align.cc.

Member Data Documentation

◆ borders

std::array<float *, 4> ButAlign::borders

◆ but

◆ dists

◆ flags

blender::char4 ButAlign::flags

◆ neighbors

ButAlign* ButAlign::neighbors[4]

The documentation for this struct was generated from the following file: