vectorgraphics / asymptote

2D & 3D TeX-Aware Vector Graphics Language
https://asymptote.sourceforge.io/
GNU General Public License v3.0
533 stars 89 forks source link

Suggestion: `envelope` type don't need `above` passed in #454

Closed user202729 closed 2 weeks ago

user202729 commented 2 months ago

Instead, it can just always assume above=true.

If the caller wants above=false, it can create a new frame and prepend it to the resulting frame itself.

Currently it needlessly duplicate the following code across the 3 types of boxes

  frame F;
  if(above == false) {
    filltype.fill(F,g,p);
    prepend(dest,F);
  } else filltype.fill(dest,g,p);

Thought?

johncbowman commented 2 weeks ago

A better idea that avoids breaking existing code is in commit c7f016286dffc4cd1805d7541d50e17d05805527.