Blender  V3.3
Public Attributes | List of all members
ButAlign Struct Reference

Public Attributes

uiButbut
 
struct ButAlignneighbors [4]
 
floatborders [4]
 
float dists [4]
 
char flags [4]
 

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 44 of file interface_align.c.

Member Data Documentation

◆ borders

float* ButAlign::borders[4]

◆ but

uiBut* ButAlign::but

◆ dists

float ButAlign::dists[4]

◆ flags

char ButAlign::flags[4]

◆ neighbors

struct ButAlign* ButAlign::neighbors[4]

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