Page MenuHome

Fix T63605: Assert squeezing a template_curve_mapping in a panel to almost zero horizontally

Authored by Philipp Oeser (lichtwerk) on Apr 16 2019, 11:53 AM.

Diff Detail

rB Blender

Event Timeline


Code style: it's better to return early than creating indentation blocks if possible.

It does not make a huge diff here in this case but better get used to it.

  • return early
  • also fix another assert (defining a zero-size button)
Philipp Oeser (lichtwerk) marked an inline comment as done.Apr 23 2019, 1:29 PM
Brecht Van Lommel (brecht) added inline comments.

Use max_ii instead here.

It doesn't make much difference in this case, but in general it's more efficient to use the function. The macro can call the uiLayoutGetWidth() function twice.

This revision is now accepted and ready to land.Apr 25 2019, 4:11 PM
This revision was automatically updated to reflect the committed changes.