Ephoto: Scale cropper correctly on zoom.
This commit is contained in:
parent
7be54bd65d
commit
6dea4f6662
|
@ -95,8 +95,17 @@ collections {
|
||||||
set_state_val(PART:"ephoto.swallow.cropper", STATE_REL2_OFFSET, ppox, ppoy);
|
set_state_val(PART:"ephoto.swallow.cropper", STATE_REL2_OFFSET, ppox, ppoy);
|
||||||
}
|
}
|
||||||
if (movetype == 9) {
|
if (movetype == 9) {
|
||||||
set_state_val(PART:"ephoto.swallow.cropper", STATE_REL1_OFFSET, 0, 0);
|
get_state_val(PART:"ephoto.swallow.cropper", STATE_REL1_OFFSET, pox, poy);
|
||||||
set_state_val(PART:"ephoto.swallow.cropper", STATE_REL2_OFFSET, 0, 0);
|
if (cx < ix)
|
||||||
|
pox += ix-cx;
|
||||||
|
if (cx+cw > ix+iw)
|
||||||
|
pox += (ix+iw)-(cx+cw);
|
||||||
|
if (cy < iy)
|
||||||
|
poy += iy-cy;
|
||||||
|
if (cy+ch > iy+ih)
|
||||||
|
poy += (iy+ih)-(cy+ch);
|
||||||
|
set_state_val(PART:"ephoto.swallow.cropper", STATE_REL1_OFFSET, pox, poy);
|
||||||
|
set_state_val(PART:"ephoto.swallow.cropper", STATE_REL2_OFFSET, pox, poy);
|
||||||
}
|
}
|
||||||
set_state(PART:"ephoto.swallow.cropper", "custom", 0.0);
|
set_state(PART:"ephoto.swallow.cropper", "custom", 0.0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue