How to use the @sketch-hq/sketch-file-format-ts.FileFormat1.WindingRule function in @sketch-hq/sketch-file-format-ts

To help you get started, we’ve selected a few @sketch-hq/sketch-file-format-ts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github airbnb / react-sketchapp / src / jsonUtils / shapeLayers.ts View on Github external
do_objectID: generateID(),
  frame,
  isLocked: false,
  isVisible: true,
  name: 'ShapeGroup',
  nameIsFixed: false,
  resizingConstraint: makeResizeConstraint(resizingConstraint),
  resizingType: FileFormat.ResizeType.Stretch,
  rotation: 0,
  shouldBreakMaskChain: false,
  style: makeStyle(style, fills, shadows),
  hasClickThrough: false,
  layers,
  clippingMaskMode: 0,
  hasClippingMask: false,
  windingRule: FileFormat.WindingRule.EvenOdd,
  isFixedToViewport: false,
  exportOptions: {
    _class: 'exportOptions',
    exportFormats: [],
    includedLayerIds: [],
    layerOptions: 0,
    shouldTrim: false,
  },
  isFlippedHorizontal: false,
  isFlippedVertical: false,
  booleanOperation: FileFormat.BooleanOperation.NA,
  layerListExpandedType: FileFormat.LayerListExpanded.Undecided,
});
github airbnb / react-sketchapp / src / jsonUtils / style.ts View on Github external
export const makeStyle = (
  style?: ViewStyle | TextStyle,
  fills?: FileFormat.Fill[],
  shadowsProp?: ViewStyle[],
): FileFormat.Style => {
  const json: FileFormat.Style = {
    _class: 'style',
    fills: [],
    miterLimit: 10,
    innerShadows: [],
    shadows: [],
    borderOptions: makeBorderOptions('solid', 0, 0, 0),
    startMarkerType: FileFormat.MarkerType.OpenArrow,
    endMarkerType: FileFormat.MarkerType.OpenArrow,
    windingRule: FileFormat.WindingRule.EvenOdd,
    colorControls: {
      _class: 'colorControls',
      isEnabled: false,
      brightness: 1,
      contrast: 1,
      hue: 1,
      saturation: 1,
    },
  };

  if (fills && fills.length) {
    json.fills = json.fills.concat(fills);
  }

  if (!style) {
    return json;