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

BooleaOperation is missing constraint peoperty (from ConstaintMixin) #77

Closed
softmarshmallow opened this issue Sep 27, 2021 · 3 comments
Closed

Comments

@softmarshmallow
Copy link

this must be

 interface BooleanOperationNode extends DefaultShapeMixin, ChildrenMixin, CornerMixin {
    readonly type: "BOOLEAN_OPERATION"
    clone(): BooleanOperationNode
    booleanOperation: "UNION" | "INTERSECT" | "SUBTRACT" | "EXCLUDE"

    expanded: boolean
  }
export interface BooleanOperationNode
  extends DefaultShapeMixin,
    ChildrenMixin,
    // CUSTOM OVERRIDE
    // ---- this is not from official plugin typings, but exists. ---
    ConstraintMixin,
    // --------------------------------------------------------------
    CornerMixin {
  readonly type: "BOOLEAN_OPERATION";
  clone(): BooleanOperationNode;
  booleanOperation: "UNION" | "INTERSECT" | "SUBTRACT" | "EXCLUDE";

  expanded: boolean;
}

the constraint property exists on remote api

@jlai-figma
Copy link
Collaborator

Boolean operations should not have a constraints field. I did a check in the console and they do not have constraints set on them. Going to close out, but please re-open if you are seeing that boolean operation nodes are being returned with a constraints field. Thanks!

@softmarshmallow
Copy link
Author

But it does have constraint on remote api definitions. BooleanOperation implements VECTOR.
https://www.figma.com/developers/api#vector-props

@glebsexy
Copy link

glebsexy commented Oct 2, 2021

I don't know about why the REST API is like this but the Plugins API closely matches the internal nodes structure of the editor. Booleans are technically similar to groups, and both don't have the constraints property. When you select a group or a boolean in the editor, it shows the constraints of the objects nested in the group, not the group itself (because, again, group doesn't have its own constraints, and it can't exist without objects inside).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants