mirror of
https://github.com/rive-app/rive-flutter.git
synced 2025-05-20 23:06:35 +08:00
Adding new clipping.
This commit is contained in:
@ -13,48 +13,46 @@ abstract class ClippingShapeBase extends Component {
|
||||
Set<int> get coreTypes => {ClippingShapeBase.typeKey, ComponentBase.typeKey};
|
||||
|
||||
/// --------------------------------------------------------------------------
|
||||
/// ShapeId field with key 92.
|
||||
int _shapeId;
|
||||
static const int shapeIdPropertyKey = 92;
|
||||
/// SourceId field with key 92.
|
||||
int _sourceId;
|
||||
static const int sourceIdPropertyKey = 92;
|
||||
|
||||
/// Identifier used to track the shape to use as a clipping source.
|
||||
int get shapeId => _shapeId;
|
||||
/// Identifier used to track the node to use as a clipping source.
|
||||
int get sourceId => _sourceId;
|
||||
|
||||
/// Change the [_shapeId] field value.
|
||||
/// [shapeIdChanged] will be invoked only if the field's value has changed.
|
||||
set shapeId(int value) {
|
||||
if (_shapeId == value) {
|
||||
/// Change the [_sourceId] field value.
|
||||
/// [sourceIdChanged] will be invoked only if the field's value has changed.
|
||||
set sourceId(int value) {
|
||||
if (_sourceId == value) {
|
||||
return;
|
||||
}
|
||||
int from = _shapeId;
|
||||
_shapeId = value;
|
||||
shapeIdChanged(from, value);
|
||||
int from = _sourceId;
|
||||
_sourceId = value;
|
||||
sourceIdChanged(from, value);
|
||||
}
|
||||
|
||||
void shapeIdChanged(int from, int to);
|
||||
void sourceIdChanged(int from, int to);
|
||||
|
||||
/// --------------------------------------------------------------------------
|
||||
/// ClipOpValue field with key 93.
|
||||
int _clipOpValue = 0;
|
||||
static const int clipOpValuePropertyKey = 93;
|
||||
/// FillRule field with key 93.
|
||||
int _fillRule = 0;
|
||||
static const int fillRulePropertyKey = 93;
|
||||
|
||||
/// Backing enum value for the clipping operation type (intersection or
|
||||
/// difference).
|
||||
int get clipOpValue => _clipOpValue;
|
||||
/// Backing enum value for the clipping fill rule (nonZero or evenOdd).
|
||||
int get fillRule => _fillRule;
|
||||
|
||||
/// Change the [_clipOpValue] field value.
|
||||
/// [clipOpValueChanged] will be invoked only if the field's value has
|
||||
/// changed.
|
||||
set clipOpValue(int value) {
|
||||
if (_clipOpValue == value) {
|
||||
/// Change the [_fillRule] field value.
|
||||
/// [fillRuleChanged] will be invoked only if the field's value has changed.
|
||||
set fillRule(int value) {
|
||||
if (_fillRule == value) {
|
||||
return;
|
||||
}
|
||||
int from = _clipOpValue;
|
||||
_clipOpValue = value;
|
||||
clipOpValueChanged(from, value);
|
||||
int from = _fillRule;
|
||||
_fillRule = value;
|
||||
fillRuleChanged(from, value);
|
||||
}
|
||||
|
||||
void clipOpValueChanged(int from, int to);
|
||||
void fillRuleChanged(int from, int to);
|
||||
|
||||
/// --------------------------------------------------------------------------
|
||||
/// IsVisible field with key 94.
|
||||
|
Reference in New Issue
Block a user