Skip to content

Commit

Permalink
Rebase the newest code
Browse files Browse the repository at this point in the history
  • Loading branch information
AdunFang committed Feb 26, 2025
1 parent 500eb4d commit daa84ab
Show file tree
Hide file tree
Showing 4 changed files with 178 additions and 81 deletions.
10 changes: 8 additions & 2 deletions src/Tizen.NUI/src/public/BaseComponents/TextUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,10 @@ public Size Size
{
set
{
Interop.EmbeddedItemInfo.SizeSet(SwigCPtr, Size.getCPtr(value));
var handle = Size.GetHandleRef(value);
Interop.EmbeddedItemInfo.SizeSet(SwigCPtr, handle);
Size.ReleaseHandleRef(handle);

if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
Expand All @@ -778,7 +781,10 @@ public Size RotatedSize
{
set
{
Interop.EmbeddedItemInfo.RotatedSizeSet(SwigCPtr, Size.getCPtr(value));
var handleRef = Size.GetHandleRef(value);
Interop.EmbeddedItemInfo.RotatedSizeSet(SwigCPtr, handleRef);
Size.ReleaseHandleRef (handleRef);

if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
Expand Down
8 changes: 7 additions & 1 deletion src/Tizen.NUI/src/public/BaseComponents/View.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5386,7 +5386,13 @@ private Size GetInternalSize()
{
internalSize = new Size(OnSizeChanged, 0, 0, 0);
}
Object.InternalRetrievingPropertyVector3(SwigCPtr, Property.SIZE, internalSize.SwigCPtr);

var w = Interop.Actor.InternalGetPropertyFloat(SwigCPtr, Property.SizeWidth);
var h = Interop.Actor.InternalGetPropertyFloat(SwigCPtr, Property.SizeHeight);
var d = Interop.Actor.InternalGetPropertyFloat(SwigCPtr, Property.SizeDepth);

internalSize.ResetValue(w, h, d);

return internalSize;
}

Expand Down
16 changes: 11 additions & 5 deletions src/Tizen.NUI/src/public/Common/PropertyValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,8 @@ public PropertyValue(PropertyValue value) : this(Interop.PropertyValue.NewProper
/// Creates a Size property value.
/// </summary>
/// <param name="vectorValue">Size values.</param>
internal PropertyValue(Size vectorValue) : this(Interop.PropertyValue.NewPropertyValueVector3(Size.getCPtr(vectorValue)), true)
internal PropertyValue(Size vectorValue) : this(vectorValue.Width, vectorValue.Height, vectorValue.Depth)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
internal PropertyValue(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
Expand Down Expand Up @@ -548,7 +547,8 @@ static public PropertyValue CreateFromObject(System.Object obj)
}
else if (type.Equals(typeof(Size)))
{
value = Interop.PropertyValue.NewPropertyValueVector3(Size.getCPtr((Size)obj));
var size = obj as Size;
value = Interop.PropertyValue.NewPropertyValueVector3Componentwise(size.Width, size.Height, size.Depth);
}
else if (type.Equals(typeof(Size2D)))
{
Expand Down Expand Up @@ -655,8 +655,14 @@ public bool Get(Position2D vectorValue)
[EditorBrowsable(EditorBrowsableState.Never)]
public bool Get(Size vectorValue)
{
bool ret = Interop.PropertyValue.GetVector3(SwigCPtr, Size.getCPtr(vectorValue));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
if (null == vectorValue)
{
throw new ArgumentNullException(nameof(vectorValue));
}

var ret = GetVector3Component(out var w, out var h, out var d);
vectorValue.ResetValue(w, h, d);

return ret;
}

Expand Down
Loading

0 comments on commit daa84ab

Please sign in to comment.