Sign In  Sign Up Live-Chat

Bizarre behaviour in Shape.Y get/set accessor

Last post 05-12-2008, 8:04 PM by msfaiz. 1 replies.
Sort Posts: Previous Next
  •  05-11-2008, 1:18 PM 126406

    Bizarre behaviour in Shape.Y get/set accessor

    Hello,

    I am using a purchased version of Aspose.Slides in a C# ASP.NET application and have stumbled upon a totally bizarre behaviour in the Shape.Y get/set property.

    It seems that if the property get is NOT called before using set, the value is not changed in the set operation!

    Here's some example code to demonstrate the behaviour:

    Save the initial value of shape.Y so that we can use it later.
    int initialShapeY = shape.Y;

    Set the TextFrame to automatically resize.
    shape.TextFrame.FitShapeToText = true;
    shape.TextFrame.Width = 3000;

     
    Some
    paragraphs/portions is added to the TextFrame of the shape.
    //Code removed for brevity

    After adding text, the shape resizes on the y-axis
    both upwards and downwards. I assume this behaviour is by design.

    To correct the Y position after automatic resizing, I want to set the Y property to the old value: initialShapeY.

     
    Example 1: shape.Y get accessor is NOT called before setting the property.
    shape.Y = initialShapeY;
    Debug.WriteLine("(adjusted) shape.Y = " + shape.Y);

     
    Result: The Y value of the shape is NOT changed to the initialShapeY value.
     
    Example 2: shape.Y set is called before calling get.

    shape.Y = shape.Y;
    shape.Y = initialShapeY;
    Debug.WriteLine("(adjusted) shape.Y = " + shape.Y);

     
    Result: The Y value of the shape is changed to the initialShapeY value.

    It does not matter if shape.Y = shape.Y is used, or if the get accessor is just printed out (i.e. using Debug.WriteLine(shape.Y).

     
  •  05-12-2008, 8:04 PM 126586 in reply to 126406

    Re: Bizarre behaviour in Shape.Y get/set accessor

    Thanks for reporting. We will investigate it and fix it as soon as possible.


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
View as RSS news feed in XML