Changes between Initial Version and Version 1 of Ticket #19330, comment 2


Ignore:
Timestamp:
Jan 1, 2025, 6:21:23 PM (5 weeks ago)
Author:
grexe

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #19330, comment 2

    initial v1  
    11I implemented this like so:
    22{{{
    3         BRegion* region = param->region;
    4         int32 regionRects = region->CountRects();
    5         BPoint points[regionRects * 4];
     3    BRegion* region = param->region;
     4    int32 regionRects = region->CountRects();
     5    BPoint points[regionRects * 4];
    66
    7         for (int32 rectNum = 0; rectNum < regionRects; rectNum++) {
    8             int32 rectPoint = 0;
    9             BRect rect = region->RectAt(rectNum);
    10             points[rectPoint++] = rect.LeftTop();
    11             points[rectPoint++] = rect.RightTop();
    12             points[rectPoint++] = rect.RightBottom();
    13             points[rectPoint++] = rect.LeftBottom();
    14         }
    15         BPolygon poly(points, regionRects * 4);
    16         StrokePolygon(&poly);
     7    for (int32 rectNum = 0; rectNum < regionRects; rectNum++) {
     8        int32 rectPoint = 0;
     9        BRect rect = region->RectAt(rectNum);
     10        points[rectPoint++] = rect.LeftTop();
     11        points[rectPoint++] = rect.RightTop();
     12        points[rectPoint++] = rect.RightBottom();
     13        points[rectPoint++] = rect.LeftBottom();
     14    }
     15    BPolygon poly(points, regionRects * 4);
     16    StrokePolygon(&poly);
    1717}}}