Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-13110

SetBrushOrgEx is broken.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • Win32SS
    • None

    Description

      I attach a test case where SetBrushOrgEx appears to have no effect. I also attach an exe that shows the problem as well as screenshots of the bug. The painting code of the test application is the following (the bug happens in the last two columns):

                  BeginPaint(hWnd, &ps);
                  HBRUSH hbrush = CreatePatternBrush(hbmp);
                  HBRUSH hbrushold = (HBRUSH)SelectObject(ps.hdc, hbrush);
                  
                  //1st column
                  PatBlt(ps.hdc, 0,0, 20, 100, PATCOPY);
                  
                  //2nd column
                  PatBlt(ps.hdc, 40,0, 20, 50, PATCOPY);
                  PatBlt(ps.hdc, 40,50, 20, 50, PATCOPY);
                  
                  //3rd column
                  PatBlt(ps.hdc, 80,0, 20, 50, PATCOPY);
                  SetViewportOrgEx(ps.hdc, 0, 50, NULL);
                  PatBlt(ps.hdc, 80,0, 20, 50, PATCOPY);
                  
                  //4th column
                  SetViewportOrgEx(ps.hdc, 0, 0, NULL);
                  PatBlt(ps.hdc, 120,0, 20, 50, PATCOPY);
                  SetViewportOrgEx(ps.hdc, 0, 50, NULL);
                  PatBlt(ps.hdc, 120,50, 20, 50, PATCOPY);
                  
                  hbrushold = (HBRUSH)SelectObject(ps.hdc, hbrushold);
                  SetViewportOrgEx(ps.hdc, 0, 0, NULL);
       
                  //5th column
                  SetRect(&rc, 160, 0, 180,100);
                  FillRect(ps.hdc, &rc, hbrush);
                  
                  //6th column
                  SetRect(&rc, 200, 0, 220,50);
                  FillRect(ps.hdc, &rc, hbrush);
                  SetRect(&rc, 200, 50, 220,100);
                  FillRect(ps.hdc, &rc, hbrush);
       
                  //7th column
                  SetRect(&rc, 240, 0, 260,50);
                  FillRect(ps.hdc, &rc, hbrush);
                  SetViewportOrgEx(ps.hdc, 0, 50, NULL);
                  SetRect(&rc, 240, 0, 260,50);
                  FillRect(ps.hdc, &rc, hbrush);
                  
                  //8th column
                  SetViewportOrgEx(ps.hdc, 0, 0, NULL);
                  SetRect(&rc, 280, 0, 300,50);
                  FillRect(ps.hdc, &rc, hbrush);            
                  SetViewportOrgEx(ps.hdc, 0, 50, NULL);
                  SetRect(&rc, 280, 50, 300,100);
                  FillRect(ps.hdc, &rc, hbrush);
                  
                  //9th column
                  SetViewportOrgEx(ps.hdc, 0, 50, NULL);
                  SetBrushOrgEx(ps.hdc, 0, 50, NULL);
                  SetRect(&rc, 320, 0, 340,100);
                  FillRect(ps.hdc, &rc, hbrush);
       
                  //10th column
                  SetRect(&rc, 360, 0, 380,50);
                  FillRect(ps.hdc, &rc, hbrush);
                  SetRect(&rc, 360, 50, 380,100);
                  FillRect(ps.hdc, &rc, hbrush);
                  DeleteObject(hbrush);
       
                  EndPaint(hWnd, &ps);

      Attachments

        1. SetBrushOrgEx bug.png
          SetBrushOrgEx bug.png
          12 kB
        2. SetBrushOrgEx correct.png
          SetBrushOrgEx correct.png
          13 kB
        3. pattern.bmp
          pattern.bmp
          6 kB
        4. test3.exe
          111 kB
        5. SetBrushOrgEx.patch
          0.5 kB
        6. snapshot103.png
          snapshot103.png
          34 kB
        7. snapshot104.png
          snapshot104.png
          43 kB
        8. SetBrushOrgEx_1.patch
          1 kB
        9. pattern_rgb.bmp
          pattern_rgb.bmp
          8 kB
        10. ReactOS.webm
          2.98 MB
        11. SetBrushOrgEx_3.patch
          3 kB
        12. SetBrushOrgEx_4.patch
          4 kB
        13. snapshot130.png
          snapshot130.png
          36 kB
        14. SetBrushOrgEx_5.patch
          3 kB
        15. gdibatch.patch
          15 kB
        16. image-2024-06-01-15-42-23-148.png
          image-2024-06-01-15-42-23-148.png
          16 kB
        17. image-2024-06-01-15-42-37-976.png
          image-2024-06-01-15-42-37-976.png
          21 kB

        Issue Links

          Activity

            People

              bug zilla Bug Zilla
              Smiley Giannis Adamopoulos
              Votes:
              7 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated: