Added NewBounds function

This commit is contained in:
Alexei Anoshenko 2024-12-03 10:45:55 +03:00
parent 32141b996a
commit 8e20e80899
3 changed files with 34 additions and 14 deletions

View File

@ -1,5 +1,6 @@
# v0.18.0
* Property name type changed from string to PropertyName.
* Renamed:
Transform interface -> TransformProperty
NewTransform function -> NewTransformProperty
@ -16,17 +17,23 @@
NewInsetViewShadow function -> NewInsetShadow
NewShadowWithParams function -> NewShadowProperty
* Property name type changed from string to PropertyName.
* Added functions: NewBounds, GetPushTransform, GetPushDuration, GetPushTiming, IsMoveToFrontAnimation,
GetBackground, GetMask, GetBackgroundClip,GetBackgroundOrigin, GetMaskClip, GetMaskOrigin.
* Changed Push, Pop, MoveToFront, and MoveToFrontByID methods of StackLayout interface.
* Removed DefaultAnimation, StartToEndAnimation, EndToStartAnimation, TopDownAnimation, and BottomUpAnimation constants.
* Added "push-transform", "push-duration", "push-timing", and "move-to-front-animation" StackLayout properties.
* Added "push-perspective", "push-rotate-x", "push-rotate-y", "push-rotate-z", "push-rotate", "push-skew-x", "push-skew-y",
"push-scale-x", "push-scale-y", "push-scale-z", "push-translate-x", "push-translate-y", "push-translate-z" StackLayout properties.
* Added StackLayout properties: "push-transform", "push-duration", "push-timing", "move-to-front-animation", "push-perspective",
"push-rotate-x", "push-rotate-y", "push-rotate-z", "push-rotate", "push-skew-x", "push-skew-y",
"push-scale-x", "push-scale-y", "push-scale-z", "push-translate-x", "push-translate-y", "push-translate-z".
* Added "show-opacity", "show-transform", "show-duration", and "show-timing" Popup properties.
* Added GetPushTransform, GetPushDuration, GetPushTiming, and IsMoveToFrontAnimation functions.
* Added "mask", "mask-clip", "mask-origin", and "background-origin" properties.
* Added GetBackground, GetMask, GetBackgroundClip,GetBackgroundOrigin, GetMaskClip, and GetMaskOrigin functions.
* Added LineJoin type. Type of constants MiterJoin, RoundJoin, and BevelJoin changed to LineJoin. Type of Canvas.SetLineJoin function argument changed to LineJoin.
* Added LineCap type. Type of constants ButtCap, RoundCap, and SquareCap changed to LineCap. Type of Canvas.SetLineCap function argument changed to LineCap.
# v0.17.3

View File

@ -35,6 +35,19 @@ func NewBoundsProperty(params Params) BoundsProperty {
return bounds
}
// NewBounds creates the new BoundsProperty object.
// The arguments specify the boundaries in a clockwise direction: "top", "right", "bottom", and "left".
// If the argument is specified as int or float64, the value is considered to be in pixels.
func NewBounds[topType SizeUnit | int | float64, rightType SizeUnit | int | float64, bottomType SizeUnit | int | float64, leftType SizeUnit | int | float64](
top topType, right rightType, bottom bottomType, left leftType) BoundsProperty {
return NewBoundsProperty(Params{
Top: top,
Right: right,
Bottom: bottom,
Left: left,
})
}
func (bounds *boundsPropertyData) init() {
bounds.dataProperty.init()
bounds.normalize = normalizeBoundsTag

View File

@ -119,11 +119,11 @@ type shadowPropertyData struct {
// NewShadow create the new shadow property for a view. Arguments:
//
// offsetX, offsetY is x and y offset of the shadow;
// offsetX, offsetY is x and y offset of the shadow (if the argument is specified as int or float64, the value is considered to be in pixels);
//
// blurRadius is the blur radius of the shadow;
// blurRadius is the blur radius of the shadow (if the argument is specified as int or float64, the value is considered to be in pixels);
//
// spreadRadius is the spread radius of the shadow;
// spreadRadius is the spread radius of the shadow (if the argument is specified as int or float64, the value is considered to be in pixels);
//
// color is the color of the shadow.
func NewShadow[xOffsetType SizeUnit | int | float64, yOffsetType SizeUnit | int | float64, blurType SizeUnit | int | float64, spreadType SizeUnit | int | float64](
@ -139,11 +139,11 @@ func NewShadow[xOffsetType SizeUnit | int | float64, yOffsetType SizeUnit | int
// NewInsetShadow create the new inset shadow property for a view. Arguments:
//
// offsetX, offsetY is x and y offset of the shadow;
// offsetX, offsetY is x and y offset of the shadow (if the argument is specified as int or float64, the value is considered to be in pixels);
//
// blurRadius is the blur radius of the shadow;
// blurRadius is the blur radius of the shadow (if the argument is specified as int or float64, the value is considered to be in pixels);
//
// spreadRadius is the spread radius of the shadow;
// spreadRadius is the spread radius of the shadow (if the argument is specified as int or float64, the value is considered to be in pixels);
//
// color is the color of the shadow.
func NewInsetShadow[xOffsetType SizeUnit | int | float64, yOffsetType SizeUnit | int | float64, blurType SizeUnit | int | float64, spreadType SizeUnit | int | float64](
@ -160,9 +160,9 @@ func NewInsetShadow[xOffsetType SizeUnit | int | float64, yOffsetType SizeUnit |
// NewTextShadow create the new text shadow property. Arguments:
//
// offsetX, offsetY is the x- and y-offset of the shadow;
// offsetX, offsetY is the x- and y-offset of the shadow (if the argument is specified as int or float64, the value is considered to be in pixels);
//
// blurRadius is the blur radius of the shadow;
// blurRadius is the blur radius of the shadow (if the argument is specified as int or float64, the value is considered to be in pixels);
//
// color is the color of the shadow.
func NewTextShadow[xOffsetType SizeUnit | int | float64, yOffsetType SizeUnit | int | float64, blurType SizeUnit | int | float64](