Mercurial > dwindows
comparison os2/dw.c @ 127:c5c3ccb84ac7
Safety checks in the splitbar calculations on OS/2 and Windows.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 20 Oct 2002 06:10:31 +0000 |
parents | 0d2cbd9d4028 |
children | ac616f625443 |
comparison
equal
deleted
inserted
replaced
126:72cb88af4490 | 127:c5c3ccb84ac7 |
---|---|
2452 int height = (rclBounds.yTop - rclBounds.yBottom); | 2452 int height = (rclBounds.yTop - rclBounds.yBottom); |
2453 | 2453 |
2454 if(type == BOXHORZ) | 2454 if(type == BOXHORZ) |
2455 { | 2455 { |
2456 start = rclFrame.xLeft - rclBounds.xLeft; | 2456 start = rclFrame.xLeft - rclBounds.xLeft; |
2457 *percent = ((float)start / (float)(rclBounds.xRight - rclBounds.xLeft - SPLITBAR_WIDTH)) * 100.0; | 2457 if(width - SPLITBAR_WIDTH > 1 && start < width - SPLITBAR_WIDTH) |
2458 *percent = ((float)start / (float)(width - SPLITBAR_WIDTH)) * 100.0; | |
2458 } | 2459 } |
2459 else | 2460 else |
2460 { | 2461 { |
2461 start = rclFrame.yBottom - rclBounds.yBottom; | 2462 start = rclFrame.yBottom - rclBounds.yBottom; |
2462 *percent = 100.0 - (((float)start / (float)(rclBounds.yTop - rclBounds.yBottom - SPLITBAR_WIDTH)) * 100.0); | 2463 if(height - SPLITBAR_WIDTH > 1 && start < height - SPLITBAR_WIDTH) |
2464 *percent = 100.0 - (((float)start / (float)(height - SPLITBAR_WIDTH)) * 100.0); | |
2463 } | 2465 } |
2464 _handle_splitbar_resize(hwnd, *percent, type, width, height); | 2466 _handle_splitbar_resize(hwnd, *percent, type, width, height); |
2465 } | 2467 } |
2466 } | 2468 } |
2467 } | 2469 } |