• AVR Freaks

Hot!Line widget issue

Author
ivan.gioia
New Member
  • Total Posts : 8
  • Reward points : 0
  • Joined: 2019/08/30 05:53:27
  • Location: 0
  • Status: offline
2019/09/18 02:41:44 (permalink)
0

Line widget issue

Hi again,
I have the following problem with the line widget (Harmony v2.06): I can draw the line at screen startup but then if I change the line points nothing is drawn, or better the line disappears.
The widget works well without GPU instead.
My situation is: PIC32MZDA, buffers in internal DDR, 90° Orientation, draw mode RGBA8888.
Have you ever seen a similar behaviour?
Thanks again,
Ivan
#1

6 Replies Related Threads

    automate
    Junior Member
    • Total Posts : 86
    • Reward points : 0
    • Joined: 2014/11/10 09:58:57
    • Location: 0
    • Status: offline
    Re: Line widget issue 2019/09/19 10:20:35 (permalink)
    0
    @ivan.gioia
     
    Unfortunately, I have been unable to reproduce your problem. Here is my test code example which proves that I can use the LineWidget1 to display a diagonal line and then update the widget to produce a horizontal line:
     
    int32_t libaria_initialize(void)
    {
     
        LineWidget1 = laLineWidget_New();
        laWidget_SetPosition((laWidget*)LineWidget1, 11, 29);
        laWidget_SetSize((laWidget*)LineWidget1, 100, 100);
        laWidget_SetBackgroundType((laWidget*)LineWidget1, LA_WIDGET_BACKGROUND_NONE);
        laWidget_SetBorderType((laWidget*)LineWidget1, LA_WIDGET_BORDER_NONE);
        laLineWidget_SetStartPoint(LineWidget1, 0, 0);
        laLineWidget_SetEndPoint(LineWidget1, 100, 100);
        laWidget_AddChild((laWidget*)layer0, (laWidget*)LineWidget1);
     
        screen = laScreen_New(LA_FALSE, LA_FALSE, &ScreenCreate_default);
        laScreen_SetOrientation(screen, LA_SCREEN_ORIENTATION_90);
        laContext_AddScreen(screen);

        laContext_SetActiveScreen(0);

        return 0;
    }
     
     
    void APP_Tasks ( void )
    {

        /* Check the application's current state. */
        switch ( appData.state )
        {
            /* Application's initial state. */
            case APP_STATE_INIT:
            {
                bool appInitialized = true;
                
                if (appInitialized)
                {
                    appData.state = APP_STATE_SERVICE_TASKS;
                }
                break;
            }
            case APP_STATE_SERVICE_TASKS:
            {
                laLineWidget_SetStartPoint(LineWidget1, 0, 10);
                laLineWidget_SetEndPoint(LineWidget1, 270, 10);
                break;
            }
            /* TODO: implement your application state machine.*/
            

            /* The default state should never be executed. */
            default:
            {
                /* TODO: Handle error in application's state machine. */
                break;
            }
        }
    }
     
    #2
    ivan.gioia
    New Member
    • Total Posts : 8
    • Reward points : 0
    • Joined: 2019/08/30 05:53:27
    • Location: 0
    • Status: offline
    Re: Line widget issue 2019/09/19 12:26:04 (permalink)
    0
    Hi automate,
    thanks for the reply.
    One question, are you using the nano2d processor? Because with the processor off it works for me.
    One difference is that you have the background set to none and I have it set to fill, tomorrow I am going to try the widget background none.
    Thanks, Ivan
    #3
    automate
    Junior Member
    • Total Posts : 86
    • Reward points : 0
    • Joined: 2014/11/10 09:58:57
    • Location: 0
    • Status: offline
    Re: Line widget issue 2019/09/19 14:34:18 (permalink)
    0
    Yes, I am using the nano2d processor and it is turned on.
     
    Make sure that you stay within the range of the line widget rectangle.
     
    For example my LineWidget is initialized to:
     
        laWidget_SetPosition((laWidget*)LineWidget1, 11, 29);
        laWidget_SetSize((laWidget*)LineWidget1, 100, 100);
     
    I just change the start point to:
           laLineWidget_SetStartPoint(LineWidget1, 0, 40);
     
    This is an offset of your display area within the LineWidget
    #4
    ivan.gioia
    New Member
    • Total Posts : 8
    • Reward points : 0
    • Joined: 2019/08/30 05:53:27
    • Location: 0
    • Status: offline
    Re: Line widget issue 2019/09/20 00:41:43 (permalink)
    0
    Hi automate,
    I think I found the problem. If I write the line with final coordinates < than initial coordinates the line is not correctly updated, it works otherwise.
    But there is another little problem wotking with nano library.
    Can you try to do the following and tell what result you obtain?
    Default line widget size 100x100, start point x=50 y=0, end point x=50 y=100, so we draw a vertical line.
    Then update the start point to x=40 y=0, so we move the line in a slight diagonal position.
    What happens to me is that i lose the last few pixels of the line, while whithout nano lib the line is completely drawn.
     
    Thanks for your support,
    Ivan
    #5
    ivan.gioia
    New Member
    • Total Posts : 8
    • Reward points : 0
    • Joined: 2019/08/30 05:53:27
    • Location: 0
    • Status: offline
    Re: Line widget issue 2019/09/20 09:01:35 (permalink)
    0
    One more question: is it possible to (or will it be) change the thickness of the line? I tried to dig into the library without success.
    Thanks, Ivan
    #6
    automate
    Junior Member
    • Total Posts : 86
    • Reward points : 0
    • Joined: 2014/11/10 09:58:57
    • Location: 0
    • Status: offline
    Re: Line widget issue 2019/09/23 10:11:16 (permalink)
    0
    The Line widget does not have a line thickness attribute. There are two alternative options:
     
    Option 1: If the line is vertical or horizontal line, a filled rectangle can be used.
     
    Option 2: If the line is diagonal, another line widget must be used in a side by side fashion
    #7
    Jump to:
    © 2019 APG vNext Commercial Version 4.5