Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the joint model validation for Drawing documents to ensure that they have either visible text, visible fill, or visible lines. #7405

Closed
Fyorl opened this issue Jul 1, 2022 · 0 comments
Assignees
Labels
bug Functionality which is not working as intended drawings Issues related to drawing tools and the drawings layer

Comments

@Fyorl
Copy link
Contributor

Fyorl commented Jul 1, 2022

Originally reported by Skimble#8601 https://discord.com/channels/170995199584108546/956306859491471420/992195364079804559

ALL MODULES DISABLED? (true)
OS, Hosting, Browser (if applicable): Windows 10, Electron, self-hosted
Short Description of bug: Text drawings that were previously valid that had Fill type of Solid but Opacity of 0 are no longer valid and won't be loaded on opening a scene.
However, the drawing edit dialog will allow the user to set fill to Solid and Opacity to 0, causing an error to immediately be thrown.
This change in validation is causing many of my current scenes to have missing text annotations, where the fill type was set to Solid and Opacity 0.
Simple steps to reproduce the bug: Create a text drawing. Set its fill type to Solid. Change opacity to 0 and note how this throws a validation error. Or, load an existing scene with text drawings that are set to fill type Solid with 0 opacity and observe the scheme validation error and lack of those drawings being visible within the scene.
Screenshots and/or console errors:

commons.js:2774 Error: Failed to initialized Drawing [E5CO22xW9paa1n0z] in Scene [vP8HnlIFFfTUTCoO]: Model Validation Error:
Drawings with a solid or pattern fill must have a non-zero fill alpha.
    at DrawingDocument.validate (commons.js:4742:21)
    at new DataModel (commons.js:4511:26)
    at new Document (commons.js:5026:7)
    at new BaseDrawing (commons.js:7434:3)
    at new ClientDocumentMixin (foundry.js:12262:5)
    at new <anonymous> (foundry.js:11435:5)
    at new DrawingDocument (foundry.js:18110:1)
    at #initialize (commons.js:2770:17)
    at new EmbeddedCollection (commons.js:2732:23)
    at Scene._initialize (commons.js:4651:32)
    at Scene._initialize (foundry.js:12296:11)
    at new DataModel (commons.js:4512:12)
    at new Document (commons.js:5026:7)
    at new BaseScene (commons.js:8754:3)
    at new ClientDocumentMixin (foundry.js:12262:5)
    at new Scene (foundry.js:19580:1)
    at Scene.fromSource (commons.js:4935:14)
    at Scenes._initialize (foundry.js:13045:34)
    at new DocumentCollection (foundry.js:13031:10)
    at new WorldCollection (foundry.js:13274:1)
    at new Scenes (foundry.js:14516:1)
    at Game.initializeDocuments (foundry.js:7207:30)
    at Game.setupGame (foundry.js:7128:10)
    at async Game._initializeGameView (foundry.js:8163:5)
@Fyorl Fyorl added bug Functionality which is not working as intended drawings Issues related to drawing tools and the drawings layer labels Jul 1, 2022
@Fyorl Fyorl added this to the Version 10 - Path to Stable milestone Jul 1, 2022
@aaclayton aaclayton self-assigned this Jul 4, 2022
@aaclayton aaclayton changed the title Drawing fill opacity cannot be zero Improve the joint model validation for Drawing documents to ensure that they have either visible text, visible fill, or visible lines. Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality which is not working as intended drawings Issues related to drawing tools and the drawings layer
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants