Display of DispStringInRectWrap does not abide by clipping rectange (SetClipRect)

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Display of DispStringInRectWrap does not abide by clipping rectange (SetClipRect)

    Hi
    I tried to put some strings in a cliprect and the clipping worked fine. However when I changed the display function from GUI_DispStringHCenterAt() to GUI_DispStringInRectWrap() the clipping rectangle stopped working.
    Is this a known issue or am I doing something wrong?

    Thanks,
    Shimona
  • Hello Shimona,

    I did a small test using the functions GUI_DispStringInRect() and GUI_SetClipRect(). It works fine on my end.

    C Source Code

    1. #include "GUI.h"
    2. /*********************************************************************
    3. *
    4. * MainTask
    5. */
    6. void MainTask(void) {
    7. const char acTest[] = "It is compatible with single-task and multitask environments, "
    8. "with a proprietary operating system or with any commercial RTOS. "
    9. "emWin is shipped as \"C\" source code.";
    10. GUI_RECT ClipRect;
    11. GUI_RECT Rect;
    12. Rect.x0 = 10;
    13. Rect.y0 = 10;
    14. Rect.x1 = 100;
    15. Rect.y1 = 100;
    16. ClipRect.x0 = 50;
    17. ClipRect.y0 = 40;
    18. ClipRect.x1 = 120;
    19. ClipRect.y1 = 120;
    20. GUI_Init();
    21. GUI_SetClipRect(&ClipRect);
    22. GUI_DispStringInRectWrap(acTest, &Rect, 0, GUI_WRAPMODE_WORD);
    23. GUI_SetClipRect(0);
    24. GUI_SetColor(GUI_LIGHTBLUE);
    25. GUI_DrawRect(Rect.x0, Rect.y0, Rect.x1, Rect.y1);
    26. GUI_DispStringAt("TextRect", Rect.x0, Rect.y1 + 5);
    27. GUI_SetColor(GUI_LIGHTRED);
    28. GUI_DrawRect(ClipRect.x0, ClipRect.y0, ClipRect.x1, ClipRect.y1);
    29. GUI_DispStringAt("ClipRect", ClipRect.x0, ClipRect.y1 + 5);
    30. while(1) {
    31. GUI_Delay(100);
    32. }
    33. }
    Display All


    Please find attached a screenshot of the application.

    Best regards,
    Adrian
    Images
    • DispStringInClipRect.png

      1.21 kB, 128×142, viewed 511 times
  • Seems to be fixed

    Hi Adrian,

    seems to be fixed between version 5.22 and 5.26.
    I use version V5.22 and there it does not work.
    Also GUI_DrawRect and maybe some other functions do not use the clipping rectangle.
    How can I upgrade to 5.26?

    Thanks, Stefan.
  • Hello Stefan,

    You are right. I checked the function in emWin V5.22. This problem was solved in emWin V5.26.

    In order to get an emWin update you will have to contact your emWin supplier. Please note that we also offer emWin upgrades which in every case include immediate updates and direct technical support via e-mail. If this is of interest for you, please contact info@segger.com for detailed information.

    Best regards,
    Adrian