Changeset 1130 for cpp/frams/canvas
 Timestamp:
 04/16/21 15:55:34 (3 years ago)
 Location:
 cpp/frams/canvas
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

cpp/frams/canvas/neurodiagram.cpp
r973 r1130 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999202 0Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 19992021 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 13 13 #include <frams/simul/simul.h> 14 14 #include "common/nonstd_time.h" 15 #include <algorithm> 15 16 16 17 #define FIELDSTRUCT NeuroDiagram … … 231 232 NeuroProbe *probe = new NeuroProbe(getNS(i)); 232 233 Pixel s = getSize(); 233 s.x = s.y = max(probe>getSize().x,min(s.x / 3, s.y / 3));234 s.x = s.y = std::max(probe>getSize().x, std::min(s.x / 3, s.y / 3)); 234 235 probes += (void*)probe; 235 236 add(probe); … … 503 504 int *dr = drawing; 504 505 int w = size.x  2, h = size.y  clienttop  clientbottom; 505 int scale = min(w, h);506 int scale = std::min(w, h); 506 507 int x0 = clienttop + leftborder + ((w > h) ? (w  h) / 2 : 0); 507 508 int y0 = clientleft + topborder + ((h > w) ? (h  w) / 2 : 0); 
cpp/frams/canvas/nn_smart_layout.cpp
r492 r1130 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 199920 15Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 19992021 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 5 5 #include "nn_layout.h" 6 6 #include <vector> 7 #include "common/nonstd_stl.h"7 #include <algorithm> 8 8 #ifdef __BORLANDC__ 9 9 #include <alloc.h> //borland needs for alloc/free … … 131 131 */ 132 132 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); 135 135 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); 138 138 if (y1 > y2) return 1; 139 139 int x, y; … … 162 162 b>dodajelement(e, einfo[e].x + dx, einfo[e].y + dy); 163 163 } 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); 168 168 169 169 DB(
Note: See TracChangeset
for help on using the changeset viewer.