|
|
| version 1.5, 2003/10/29 21:35:58 | version 1.6, 2003/10/30 09:08:50 |
|---|---|
| Line 492 static void movingproc(RECT *rect) { | Line 492 static void movingproc(RECT *rect) { |
| return; | return; |
| } | } |
| changes = FALSE; | if (toolwin.winflg & 0x03) { |
| do { | toolwin.wingx += rect->left - toolwin.wintx; |
| if (toolwin.winflg & 1) { | rect->left = toolwin.wintx; |
| toolwin.wingx += rect->left - toolwin.wintx; | if ((toolwin.wingx >= SNAPDOTREL) || (toolwin.wingx <= -SNAPDOTREL)) { |
| rect->left = toolwin.wintx; | toolwin.winflg &= ~0x03; |
| rect->left += toolwin.wingx; | |
| toolwin.wingx = 0; | |
| } | |
| rect->right = rect->left + winlx; | |
| } | |
| if (toolwin.winflg & 0x0c) { | |
| toolwin.wingy += rect->top - toolwin.winty; | |
| rect->top = toolwin.winty; | |
| if ((toolwin.wingy >= SNAPDOTREL) || (toolwin.wingy <= -SNAPDOTREL)) { | |
| toolwin.winflg &= ~0x0c; | |
| rect->top += toolwin.wingy; | |
| toolwin.wingy = 0; | |
| } | } |
| else { | rect->bottom = rect->top + winly; |
| d = SNAPDOTPULL; | } |
| connectx = ((rect->right >= mainrc.left) && (rect->left <= mainrc.right)); | |
| connecty = ((rect->bottom >= mainrc.top) && (rect->top <= mainrc.bottom)); | |
| if ((!connectx) || (!connecty)) { | |
| if (toolwin.winflg & 0x01) { | |
| toolwin.winflg &= ~0x01; | |
| rect->left += toolwin.wingx; | |
| rect->right = rect->left + winlx; | |
| toolwin.wingx = 0; | |
| } | |
| if (toolwin.winflg & 0x04) { | |
| toolwin.winflg &= ~0x04; | |
| rect->top += toolwin.wingy; | |
| rect->bottom = rect->top + winly; | |
| toolwin.wingy = 0; | |
| } | |
| } | |
| do { | |
| changes = FALSE; | |
| if ((!(toolwin.winflg & 0x01)) && | |
| (rect->bottom >= mainrc.top) && (rect->top <= mainrc.bottom)) { | |
| do { | do { |
| connecty = ((rect->bottom >= mainrc.top) && | d = rect->left - mainrc.right; |
| (rect->top <= mainrc.bottom)); | if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { |
| if (connecty) { | break; |
| d = rect->left - mainrc.right; | } |
| d = rect->right - mainrc.left; | |
| if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { | |
| break; | |
| } | |
| if ((rect->bottom == mainrc.top) || | |
| (rect->top == mainrc.bottom)) { | |
| d = rect->left - mainrc.left; | |
| if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { | if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { |
| break; | break; |
| } | } |
| d = rect->right - mainrc.left; | d = rect->right - mainrc.right; |
| if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { | if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { |
| break; | break; |
| } | } |
| if ((rect->bottom == mainrc.top) || | |
| (rect->top == mainrc.bottom)) { | |
| d = rect->left - mainrc.left; | |
| if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { | |
| break; | |
| } | |
| d = rect->right - mainrc.right; | |
| if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { | |
| break; | |
| } | |
| } | |
| } | } |
| } while(0); | |
| if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { | |
| toolwin.winflg |= 0x01; | |
| rect->left -= d; | |
| rect->right = rect->left + winlx; | |
| toolwin.wingx = d; | |
| toolwin.wintx = rect->left; | |
| changes = TRUE; | |
| } | |
| } | |
| if (!(toolwin.winflg & 0x03)) { | |
| do { | |
| d = rect->left - workrc.left; | d = rect->left - workrc.left; |
| if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { | if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { |
| break; | break; |
| Line 534 static void movingproc(RECT *rect) { | Line 576 static void movingproc(RECT *rect) { |
| } | } |
| } while(0); | } while(0); |
| if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { | if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { |
| toolwin.winflg |= 1; | toolwin.winflg |= 0x02; |
| rect->left -= d; | rect->left -= d; |
| rect->right = rect->left + winlx; | |
| toolwin.wingx = d; | toolwin.wingx = d; |
| toolwin.wintx = rect->left; | toolwin.wintx = rect->left; |
| changes = TRUE; | |
| } | } |
| } | } |
| if ((toolwin.wingx >= SNAPDOTREL) || (toolwin.wingx <= -SNAPDOTREL)) { | |
| toolwin.winflg &= ~1; | |
| rect->left += toolwin.wingx; | |
| toolwin.wingx = 0; | |
| } | |
| rect->right = rect->left + winlx; | |
| if (changes) { | |
| break; | |
| } | |
| if (toolwin.winflg & 2) { | if ((!(toolwin.winflg & 0x04)) && |
| toolwin.wingy += rect->top - toolwin.winty; | (rect->right >= mainrc.left) && (rect->left <= mainrc.right)) { |
| rect->top = toolwin.winty; | |
| } | |
| else { | |
| d = SNAPDOTPULL; | |
| do { | do { |
| connectx = ((rect->right >= mainrc.left) && | d = rect->top - mainrc.bottom; |
| (rect->left <= mainrc.right)); | if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { |
| if (connectx) { | break; |
| d = rect->top - mainrc.bottom; | } |
| d = rect->bottom - mainrc.top; | |
| if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { | |
| break; | |
| } | |
| if ((rect->right == mainrc.left) || | |
| (rect->left == mainrc.right)) { | |
| d = rect->top - mainrc.top; | |
| if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { | if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { |
| break; | break; |
| } | } |
| d = rect->bottom - mainrc.top; | d = rect->bottom - mainrc.bottom; |
| if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { | if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { |
| break; | break; |
| } | } |
| if ((rect->right == mainrc.left) || | |
| (rect->left == mainrc.right)) { | |
| d = rect->top - mainrc.top; | |
| if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { | |
| break; | |
| } | |
| d = rect->bottom - mainrc.bottom; | |
| if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { | |
| break; | |
| } | |
| } | |
| } | } |
| } while(0); | |
| if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { | |
| toolwin.winflg |= 0x04; | |
| rect->top -= d; | |
| rect->bottom = rect->top + winly; | |
| toolwin.wingy = d; | |
| toolwin.winty = rect->top; | |
| changes = TRUE; | |
| } | |
| } | |
| if (!(toolwin.winflg & 0x0c)) { | |
| do { | |
| d = rect->top - workrc.top; | d = rect->top - workrc.top; |
| if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { | if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { |
| break; | break; |
| Line 591 static void movingproc(RECT *rect) { | Line 629 static void movingproc(RECT *rect) { |
| } | } |
| } while(0); | } while(0); |
| if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { | if ((d < SNAPDOTPULL) && (d > -SNAPDOTPULL)) { |
| toolwin.winflg |= 2; | toolwin.winflg |= 0x08; |
| rect->top -= d; | rect->top -= d; |
| rect->bottom = rect->top + winly; | |
| toolwin.wingy = d; | toolwin.wingy = d; |
| toolwin.winty = rect->top; | toolwin.winty = rect->top; |
| changes = TRUE; | changes = TRUE; |
| } | } |
| } | } |
| if ((toolwin.wingy >= SNAPDOTREL) || (toolwin.wingy <= -SNAPDOTREL)) { | |
| toolwin.winflg &= ~2; | |
| rect->top += toolwin.wingy; | |
| toolwin.wingy = 0; | |
| changes = TRUE; | |
| } | |
| rect->bottom = rect->top + winly; | |
| } while(changes); | } while(changes); |
| connectx = ((rect->right >= mainrc.left) && (rect->left <= mainrc.right)); | |
| connecty = ((rect->bottom >= mainrc.top) && (rect->top <= mainrc.bottom)); | |
| if ((toolwin.winflg & 3) && ((!connectx) || (!connecty))) { | |
| toolwin.winflg &= ~3; | |
| rect->left += toolwin.wingx; | |
| rect->top += toolwin.wingy; | |
| rect->right = rect->left + winlx; | |
| rect->bottom = rect->top + winly; | |
| toolwin.wingx = 0; | |
| toolwin.wingy = 0; | |
| } | |
| } | } |