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

        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: