Skip to content

Layer::is_locked tests bit 0x04, but the LAYER values word puts locked at 0x08 (0x04 is frozen-in-new-viewports) #26

Closed

Description

@DrunkOnJava

src/tables/layer.rs: is_locked() returns flags & 0x04 != 0. In the DWG LAYER values BS (spec §20.4.53) the bits are 0x01 frozen, 0x02 on (inverted sense on some releases), 0x04 frozen in new viewports, 0x08 locked, 0x10 plotting, 0x3E0 lineweight. #23's Layer_Lock reads 0x03F8 for the R2007+ path; the pre-R2007 accessor still tests 0x04.

Fixing it changes pre-R2007 behaviour and an existing unit test, so it was deliberately left out of #23. Do: fix the mask, fix the doc comment ("Bit 0x04 of flags: the layer is locked" is wrong), update the test, and add is_frozen_in_new_viewports() for 0x04 so the bit is not lost.

Activity

  1. added
    type:bug
    and removed on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions