mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Add Settings interface (#32352)
Add test for settings on paper and new created PaperScope instance
This commit is contained in:
committed by
Pranav Senthilnathan
parent
78feba7772
commit
4a91c57f19
48
types/paper/index.d.ts
vendored
48
types/paper/index.d.ts
vendored
@@ -21,26 +21,7 @@ declare module paper {
|
||||
/**
|
||||
* Gives access to paper's configurable settings.
|
||||
*/
|
||||
export var settings: {
|
||||
|
||||
/**
|
||||
* controls whether newly created items are automatically inserted into the scene graph, by adding them to project.activeLayer — default: true
|
||||
*/
|
||||
insertItems: boolean;
|
||||
/**
|
||||
* controls what value newly created items have their item.applyMatrix property set to (Note that not all items can set this to false) — default: true
|
||||
*/
|
||||
applyMatrix: boolean;
|
||||
/**
|
||||
* the size of the curve handles when drawing selections — default: 4
|
||||
*/
|
||||
handleSize: number;
|
||||
/*
|
||||
* the default tolerance for hit- tests, when no value is specified — default: 0
|
||||
*/
|
||||
hitTolerance: number;
|
||||
|
||||
};
|
||||
export var settings: Settings;
|
||||
|
||||
/**
|
||||
* The currently active project.
|
||||
@@ -1163,13 +1144,7 @@ declare module paper {
|
||||
/**
|
||||
* Gives access to paper's configurable settings.
|
||||
*/
|
||||
settings: {
|
||||
|
||||
applyMatrix: boolean;
|
||||
handleSize: number;
|
||||
hitTolerance: number;
|
||||
|
||||
};
|
||||
settings: Settings;
|
||||
|
||||
/**
|
||||
* The currently active project.
|
||||
@@ -5481,6 +5456,25 @@ declare module paper {
|
||||
type: 'mousedown' | 'mouseup' | 'mousedrag' | 'click' | 'doubleclick' | 'mousemove' | 'mouseenter' | 'mouseleave';
|
||||
|
||||
}
|
||||
|
||||
export interface Settings {
|
||||
/**
|
||||
* controls whether newly created items are automatically inserted into the scene graph, by adding them to project.activeLayer — default: true
|
||||
*/
|
||||
insertItems: boolean;
|
||||
/**
|
||||
* controls what value newly created items have their item.applyMatrix property set to (Note that not all items can set this to false) — default: true
|
||||
*/
|
||||
applyMatrix: boolean;
|
||||
/**
|
||||
* the size of the curve handles when drawing selections — default: 4
|
||||
*/
|
||||
handleSize: number;
|
||||
/*
|
||||
* the default tolerance for hit- tests, when no value is specified — default: 0
|
||||
*/
|
||||
hitTolerance: number;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'paper'
|
||||
|
||||
@@ -81,6 +81,10 @@ hitTestResults = paper.project.hitTestAll(hitTestPoint, hitOptionsInterfaceFull)
|
||||
|
||||
paper.view.scaling = new paper.Point(1, 1);
|
||||
|
||||
paper.settings.insertItems = true
|
||||
const paperScope = new paper.PaperScope();
|
||||
paperScope.settings.insertItems = false;
|
||||
|
||||
function Examples() {
|
||||
function BooleanOperations(){
|
||||
let text = new paper.PointText({
|
||||
|
||||
Reference in New Issue
Block a user