Ignore:
Timestamp:
04/16/21 15:55:34 (3 years ago)
Author:
Maciej Komosinski
Message:

Used std::min(), std::max() explicitly to avoid compiler confusion. Used std::size() explicitly instead of the equivalent macro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/canvas/nn_smart_layout.cpp

    r492 r1130  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
    55#include "nn_layout.h"
    66#include <vector>
    7 #include "common/nonstd_stl.h"
     7#include <algorithm>
    88#ifdef __BORLANDC__
    99 #include <alloc.h> //borland needs for alloc/free
     
    131131           */
    132132        int x1, y1, x2, y2; // union rectangle
    133         x1 = max(0, b2->minx - b->minx + dx);
    134         x2 = min(b->maxx - b->minx, -b->minx + dx + b2->maxx);
     133        x1 = std::max(0, b2->minx - b->minx + dx);
     134        x2 = std::min(b->maxx - b->minx, -b->minx + dx + b2->maxx);
    135135        if (x1 > x2) return 1;
    136         y1 = max(0, b2->miny - b->miny + dy);
    137         y2 = min(b->maxy - b->miny, -b->miny + dy + b2->maxy);
     136        y1 = std::max(0, b2->miny - b->miny + dy);
     137        y2 = std::min(b->maxy - b->miny, -b->miny + dy + b2->maxy);
    138138        if (y1 > y2) return 1;
    139139        int x, y;
     
    162162                b->dodajelement(e, einfo[e].x + dx, einfo[e].y + dy);
    163163        }
    164         b->minx = min(b->minx, dx + b2->minx);
    165         b->miny = min(b->miny, dy + b2->miny);
    166         b->maxx = max(b->maxx, dx + b2->maxx);
    167         b->maxy = max(b->maxy, dy + b2->maxy);
     164        b->minx = std::min(b->minx, dx + b2->minx);
     165        b->miny = std::min(b->miny, dy + b2->miny);
     166        b->maxx = std::max(b->maxx, dx + b2->maxx);
     167        b->maxy = std::max(b->maxy, dy + b2->maxy);
    168168
    169169        DB(
Note: See TracChangeset for help on using the changeset viewer.