Login  Register

Re: Incorrect pen results from the entitycontainer

Posted by sand1024 on Jan 31, 2025; 5:41pm
URL: https://forum.librecad.org/Incorrect-pen-results-from-the-entitycontainer-tp5726283p5726284.html

This is correct behavior.

Please take a look to the method's signature
RS_Pen getPen(bool resolve = true) const;

By default, pen is resolved - it means, that the method returns resolved pen, i.e final pen that will be used for drawing.

In such case, if something is "by layer" - it's resolved to the attribute from the level etc.

So, if you need the pen set on the entity itself (where "By Layer"/"By Type" values are fine) - you need to use call like

  if (e->getId() == en->value())
            {
                RS_Pen pen = e->getPen(false);

                lclValueVec *entity = new lclValueVec;