- left = nrnd(sizex - 1);
- top = nrnd(sizey);
- width = nrnd(sizex - left);
- height = nrnd(sizey - top);
-
- toleft = left;
- totop = top;
-
- if (mode == IN || mode == OUT) {
- int x = left+(width/2);
- int y = top+(height/2);
- int cx = sizex/2;
- int cy = sizey/2;
- if (mode == IN) {
- if (x > cx && y > cy) bias = upleft_bias;
- else if (x < cx && y > cy) bias = upright_bias;
- else if (x < cx && y < cy) bias = downright_bias;
- else /* (x > cx && y < cy)*/ bias = downleft_bias;
- } else {
- if (x > cx && y > cy) bias = downright_bias;
- else if (x < cx && y > cy) bias = downleft_bias;
- else if (x < cx && y < cy) bias = upleft_bias;
- else /* (x > cx && y < cy)*/ bias = upright_bias;
+ if (mode == MELT || mode == STRETCH) {
+ left = nrnd(sizex/2);
+ top = nrnd(sizey);
+ width = nrnd( sizex/2 ) + sizex/2 - left;
+ height = nrnd(sizey - top);
+ toleft = left;
+ totop = top+1;
+
+ } else {
+
+ left = nrnd(sizex - 1);
+ top = nrnd(sizey);
+ width = nrnd(sizex - left);
+ height = nrnd(sizey - top);
+
+ toleft = left;
+ totop = top;
+ if (mode == IN || mode == OUT) {
+ int x = left+(width/2);
+ int y = top+(height/2);
+ int cx = sizex/2;
+ int cy = sizey/2;
+ if (mode == IN) {
+ if (x > cx && y > cy) bias = upleft_bias;
+ else if (x < cx && y > cy) bias = upright_bias;
+ else if (x < cx && y < cy) bias = downright_bias;
+ else /* (x > cx && y < cy)*/ bias = downleft_bias;
+ } else {
+ if (x > cx && y > cy) bias = downright_bias;
+ else if (x < cx && y > cy) bias = downleft_bias;
+ else if (x < cx && y < cy) bias = upleft_bias;
+ else /* (x > cx && y < cy)*/ bias = upright_bias;
+ }