Adding support for corner radius.

This commit is contained in:
Luigi Rosso
2021-04-19 16:54:27 -07:00
parent bbee63bb6c
commit ff57f57781
6 changed files with 184 additions and 28 deletions

View File

@ -627,9 +627,29 @@ class RiveCoreContext {
object.originY = value;
}
break;
case RectangleBase.cornerRadiusPropertyKey:
case RectangleBase.linkCornerRadiusPropertyKey:
if (object is RectangleBase && value is bool) {
object.linkCornerRadius = value;
}
break;
case RectangleBase.cornerRadiusTLPropertyKey:
if (object is RectangleBase && value is double) {
object.cornerRadius = value;
object.cornerRadiusTL = value;
}
break;
case RectangleBase.cornerRadiusTRPropertyKey:
if (object is RectangleBase && value is double) {
object.cornerRadiusTR = value;
}
break;
case RectangleBase.cornerRadiusBLPropertyKey:
if (object is RectangleBase && value is double) {
object.cornerRadiusBL = value;
}
break;
case RectangleBase.cornerRadiusBRPropertyKey:
if (object is RectangleBase && value is double) {
object.cornerRadiusBR = value;
}
break;
case CubicMirroredVertexBase.rotationPropertyKey:
@ -895,7 +915,10 @@ class RiveCoreContext {
case ParametricPathBase.heightPropertyKey:
case ParametricPathBase.originXPropertyKey:
case ParametricPathBase.originYPropertyKey:
case RectangleBase.cornerRadiusPropertyKey:
case RectangleBase.cornerRadiusTLPropertyKey:
case RectangleBase.cornerRadiusTRPropertyKey:
case RectangleBase.cornerRadiusBLPropertyKey:
case RectangleBase.cornerRadiusBRPropertyKey:
case CubicMirroredVertexBase.rotationPropertyKey:
case CubicMirroredVertexBase.distancePropertyKey:
case PolygonBase.cornerRadiusPropertyKey:
@ -935,6 +958,7 @@ class RiveCoreContext {
case ShapePaintBase.isVisiblePropertyKey:
case StrokeBase.transformAffectsStrokePropertyKey:
case PointsPathBase.isClosedPropertyKey:
case RectangleBase.linkCornerRadiusPropertyKey:
case ClippingShapeBase.isVisiblePropertyKey:
return boolType;
default:
@ -1108,8 +1132,14 @@ class RiveCoreContext {
return (object as ParametricPathBase).originX;
case ParametricPathBase.originYPropertyKey:
return (object as ParametricPathBase).originY;
case RectangleBase.cornerRadiusPropertyKey:
return (object as RectangleBase).cornerRadius;
case RectangleBase.cornerRadiusTLPropertyKey:
return (object as RectangleBase).cornerRadiusTL;
case RectangleBase.cornerRadiusTRPropertyKey:
return (object as RectangleBase).cornerRadiusTR;
case RectangleBase.cornerRadiusBLPropertyKey:
return (object as RectangleBase).cornerRadiusBL;
case RectangleBase.cornerRadiusBRPropertyKey:
return (object as RectangleBase).cornerRadiusBR;
case CubicMirroredVertexBase.rotationPropertyKey:
return (object as CubicMirroredVertexBase).rotation;
case CubicMirroredVertexBase.distancePropertyKey:
@ -1196,6 +1226,8 @@ class RiveCoreContext {
return (object as StrokeBase).transformAffectsStroke;
case PointsPathBase.isClosedPropertyKey:
return (object as PointsPathBase).isClosed;
case RectangleBase.linkCornerRadiusPropertyKey:
return (object as RectangleBase).linkCornerRadius;
case ClippingShapeBase.isVisiblePropertyKey:
return (object as ClippingShapeBase).isVisible;
}
@ -1442,8 +1474,17 @@ class RiveCoreContext {
case ParametricPathBase.originYPropertyKey:
(object as ParametricPathBase).originY = value;
break;
case RectangleBase.cornerRadiusPropertyKey:
(object as RectangleBase).cornerRadius = value;
case RectangleBase.cornerRadiusTLPropertyKey:
(object as RectangleBase).cornerRadiusTL = value;
break;
case RectangleBase.cornerRadiusTRPropertyKey:
(object as RectangleBase).cornerRadiusTR = value;
break;
case RectangleBase.cornerRadiusBLPropertyKey:
(object as RectangleBase).cornerRadiusBL = value;
break;
case RectangleBase.cornerRadiusBRPropertyKey:
(object as RectangleBase).cornerRadiusBR = value;
break;
case CubicMirroredVertexBase.rotationPropertyKey:
(object as CubicMirroredVertexBase).rotation = value;
@ -1566,6 +1607,9 @@ class RiveCoreContext {
case PointsPathBase.isClosedPropertyKey:
(object as PointsPathBase).isClosed = value;
break;
case RectangleBase.linkCornerRadiusPropertyKey:
(object as RectangleBase).linkCornerRadius = value;
break;
case ClippingShapeBase.isVisiblePropertyKey:
(object as ClippingShapeBase).isVisible = value;
break;