Whether to show and drag or double click border-radius
Members
roundRelative
% Can be used instead of the absolute px
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
roundable: true,
roundRelative: false,
});
moveable.on("roundStart", e => {
console.log(e);
}).on("round", e => {
e.target.style.borderRadius = e.borderRadius;
}).on("roundEnd", e => {
console.log(e);
});
roundPadding
- Source:
- Default Value:
- false
The padding value of the position of the round control
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
roundable: true,
roundPadding: 0,
});
moveable.roundPadding = 15;
roundClickable
- Source:
- Default Value:
- true
Whether you can add/delete round controls by double-clicking a line or control.
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
roundable: true,
roundRelative: false,
roundClickable: true,
});
moveable.roundClickable = false;
roundable
Whether to show and drag or double click border-radius, (default: false)
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
roundable: true,
roundRelative: false,
});
moveable.on("roundStart", e => {
console.log(e);
}).on("round", e => {
e.target.style.borderRadius = e.borderRadius;
}).on("roundEnd", e => {
console.log(e);
});
minRoundControls
Minimum number of round controls. It moves in proportion by control. [horizontal, vertical] (default: [0, 0])
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
roundable: true,
roundRelative: false,
minRoundControls: [0, 0],
});
moveable.minRoundControls = [1, 0];
maxRoundControls
Maximum number of round controls. It moves in proportion by control. [horizontal, vertical] (default: [4, 4])
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
roundable: true,
roundRelative: false,
maxRoundControls: [4, 4],
});
moveable.maxRoundControls = [1, 0];
isDisplayShadowRoundControls
- Source:
- Default Value:
- false
Whether to show a round control that does not actually exist as a shadow
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
roundable: true,
isDisplayShadowRoundControls: false,
});
moveable.isDisplayShadowRoundControls = true;
Type Definitions
OnRound
Properties:
currentTarget:
MoveableManagerInterface<Record<string, any>, Record<string, any>>
The Moveable instance
moveable:
MoveableManagerInterface<Record<string, any>, Record<string, any>>
The Moveable instance
clientX:
number
The horizontal coordinate within the application's client area at which the event occurred.
clientY:
number
The vertical coordinate within the application's client area at which the event occurred.
Type:
- TSInterface
OnRoundEnd
Properties:
currentTarget:
MoveableManagerInterface<Record<string, any>, Record<string, any>>
The Moveable instance
moveable:
MoveableManagerInterface<Record<string, any>, Record<string, any>>
The Moveable instance
clientX:
number
The horizontal coordinate within the application's client area at which the event occurred.
clientY:
number
The vertical coordinate within the application's client area at which the event occurred.
Type:
- TSInterface
OnRoundGroup
Properties:
Type:
- TSInterface
OnRoundGroupEnd
Properties:
Type:
- TSInterface
OnRoundGroupStart
Properties:
Type:
- TSInterface
OnRoundStart
Properties:
currentTarget:
MoveableManagerInterface<Record<string, any>, Record<string, any>>
The Moveable instance
moveable:
MoveableManagerInterface<Record<string, any>, Record<string, any>>
The Moveable instance
clientX:
number
The horizontal coordinate within the application's client area at which the event occurred.
clientY:
number
The vertical coordinate within the application's client area at which the event occurred.
Type:
- TSInterface
RoundableOptions
Properties:
roundRelative
optional
Default Value: false
roundRelative?:
boolean
% Can be used instead of the absolute px
minRoundControls
optional
Default Value: [0, 0]
minRoundControls?:
number[]
Minimum number of round controls. It moves in proportion by control. [horizontal, vertical]
maxRoundControls
optional
Default Value: [4, 4]
maxRoundControls?:
number[]
Maximum number of round controls. It moves in proportion by control. [horizontal, vertical]
roundClickable
optional
Default Value: true
roundClickable?:
boolean | "line" | "control"
Whether you can add/delete round controls by double-clicking a line or control.
isDisplayShadowRoundControls
optional
Default Value: false
isDisplayShadowRoundControls?:
boolean | "horizontal"
Whether to show a round control that does not actually exist as a shadow
roundPadding
optional
Default Value: 0
roundPadding?:
number
The padding value of the position of the round control
Type:
- TSInterface
Events
round
When drag or double click the border area or controls, the `round` event is called.
Type | Description |
---|---|
Moveable.Roundable.OnRound | Parameters for the `round` event |
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
roundable: true,
roundRelative: false,
});
moveable.on("roundStart", e => {
console.log(e);
}).on("round", e => {
e.target.style.borderRadius = e.borderRadius;
}).on("roundEnd", e => {
console.log(e);
});
roundEnd
When drag end the border area or controls, the `roundEnd` event is called.
Type | Description |
---|---|
Moveable.Roundable.onRoundEnd | Parameters for the `roundEnd` event |
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
roundable: true,
roundRelative: false,
});
moveable.on("roundStart", e => {
console.log(e);
}).on("round", e => {
e.target.style.borderRadius = e.borderRadius;
}).on("roundEnd", e => {
console.log(e);
});
roundGroup
When drag or double click the border area or controls, the `roundGroup` event is called.
Type | Description |
---|---|
Moveable.Roundable.OnRoundGroup | Parameters for the `roundGroup` event |
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
targets: [target1, target2, target3],
roundable: true,
});
moveable.on("roundGroupStart", e => {
console.log(e.targets);
}).on("roundGroup", e => {
e.events.forEach(ev => {
ev.target.style.cssText += ev.cssText;
});
}).on("roundGroupEnd", e => {
console.log(e);
});
roundGroupEnd
When drag end the border area or controls, the `roundGroupEnd` event is called.
Type | Description |
---|---|
Moveable.Roundable.onRoundGroupEnd | Parameters for the `roundGroupEnd` event |
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
targets: [target1, target2, target3],
roundable: true,
});
moveable.on("roundGroupStart", e => {
console.log(e.targets);
}).on("roundGroup", e => {
e.events.forEach(ev => {
ev.target.style.cssText += ev.cssText;
});
}).on("roundGroupEnd", e => {
console.log(e);
});
roundGroupStart
When drag start the clip area or controls, the `roundGroupStart` event is called.
Type | Description |
---|---|
Moveable.Roundable.OnRoundGroupStart | Parameters for the `roundGroupStart` event |
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
targets: [target1, target2, target3],
roundable: true,
});
moveable.on("roundGroupStart", e => {
console.log(e.targets);
}).on("roundGroup", e => {
e.events.forEach(ev => {
ev.target.style.cssText += ev.cssText;
});
}).on("roundGroupEnd", e => {
console.log(e);
});
roundStart
When drag start the clip area or controls, the `roundStart` event is called.
Type | Description |
---|---|
Moveable.Roundable.OnRoundStart | Parameters for the `roundStart` event |
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
roundable: true,
roundRelative: false,
});
moveable.on("roundStart", e => {
console.log(e);
}).on("round", e => {
e.target.style.borderRadius = e.borderRadius;
}).on("roundEnd", e => {
console.log(e);
});