diff --git a/.eslintrc b/.eslintrc index b80427d0..29f125ed 100644 --- a/.eslintrc +++ b/.eslintrc @@ -53,7 +53,7 @@ "MSDocumentData": "readonly", "MSSymbolMaster": "readonly", "MSSymbolInstance": "readonly", - "MSAvailableOverride": "readonly", + "MSOverridePoint": "readonly", "MSAssetLibrary": "readonly", "MSDocument": "readonly", "NSURL": "readonly", diff --git a/SketchAPI.xcodeproj/xcshareddata/xcschemes/Sketch API.xcscheme b/SketchAPI.xcodeproj/xcshareddata/xcschemes/Sketch API.xcscheme index 6e6cffee..9332b68d 100644 --- a/SketchAPI.xcodeproj/xcshareddata/xcschemes/Sketch API.xcscheme +++ b/SketchAPI.xcodeproj/xcshareddata/xcschemes/Sketch API.xcscheme @@ -1,6 +1,6 @@ { // add the instance to the page document.selectedPage.layers = document.selectedPage.layers.concat(instance) - expect(instance.overrides.length).toBe(1) - expect(instance.overrides[0].property).toBe('image') + expect(instance.overrides.length).toBe(2) + + // check image resize behavior + expect(instance.overrides[0].property).toBe('imageResizeBehavior') expect(instance.overrides[0].isDefault).toBe(true) - expect(instance.overrides[0].value.type).toBe('ImageData') + expect(instance.overrides[0].value).toBe('Original') - instance.overrides[0].value = { + instance.overrides[0].value = '1' + + expect(instance.overrides[0].property).toBe('imageResizeBehavior') + expect(instance.overrides[0].isDefault).toBe(false) + expect(instance.overrides[0].value).toBe('1') + + // check image + expect(instance.overrides[1].property).toBe('image') + expect(instance.overrides[1].isDefault).toBe(true) + expect(instance.overrides[1].value.type).toBe('ImageData') + + instance.overrides[1].value = { base64: base64Image2, } - expect(instance.overrides[0].property).toBe('image') - expect(instance.overrides[0].isDefault).toBe(false) - expect(instance.overrides[0].value.type).toBe('ImageData') + expect(instance.overrides[1].property).toBe('image') + expect(instance.overrides[1].isDefault).toBe(false) + expect(instance.overrides[1].value.type).toBe('ImageData') }) test('hidden layers should not be editable', (_context, document) => { diff --git a/Source/settings/Settings.js b/Source/settings/Settings.js index c82d5bd2..6e7f7382 100644 --- a/Source/settings/Settings.js +++ b/Source/settings/Settings.js @@ -91,7 +91,7 @@ function getNativeStorageObject(layer) { if (!layer._isWrappedObject) { object = layer } else if (layer.type === 'DataOverride') { - object = layer.sketchObject.availableOverride().overrideValue() + object = layer.sketchObject.overridePoint().overrideValue() } else if (layer.type === 'Override') { object = layer.sketchObject.overrideValue() } else {