Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/view2d_ops.c
| Context not available. | |||||
| } | } | ||||
| dy = fac * BLI_rctf_size_y(&v2d->cur) / 10.0f; | dy = fac * BLI_rctf_size_y(&v2d->cur) / 10.0f; | ||||
| /* support trackpad zoom to always zoom entirely - the v2d code uses portrait or | /* Support zoom to always zoom entirely. Only respect Zoom Axis user setting | ||||
| * landscape exceptions */ | * if the view does not have any zoom restrictions any will be scaled uniformly. */ | ||||
| if (v2d->keepzoom & V2D_KEEPASPECT) { | if (v2d->keepzoom & V2D_KEEPASPECT) { | ||||
| if ((v2d->keepzoom & V2D_LOCKZOOM_X) == 0 && (v2d->keepzoom & V2D_LOCKZOOM_Y) == 0) { | |||||
| if (U.uiflag & USER_ZOOM_HORIZ) { | |||||
| dy = 0; | |||||
| } | |||||
| else { | |||||
| dx = 0; | |||||
| } | |||||
| } | |||||
| if (fabsf(dx) > fabsf(dy)) { | if (fabsf(dx) > fabsf(dy)) { | ||||
| dy = dx; | dy = dx; | ||||
| } | } | ||||
| Context not available. | |||||
| fac = zoomfac * (event->y - vzd->lasty); | fac = zoomfac * (event->y - vzd->lasty); | ||||
| dy = fac * BLI_rctf_size_y(&v2d->cur); | dy = fac * BLI_rctf_size_y(&v2d->cur); | ||||
| /* Only respect user setting zoom axis if the view does not have any zoom restrictions | /* Support zoom to always zoom entirely. Only respect Zoom Axis user setting | ||||
| * any will be scaled uniformly */ | * if the view does not have any zoom restrictions any will be scaled uniformly. */ | ||||
| if ((v2d->keepzoom & V2D_LOCKZOOM_X) == 0 && (v2d->keepzoom & V2D_LOCKZOOM_Y) == 0 && | if (v2d->keepzoom & V2D_KEEPASPECT) { | ||||
| (v2d->keepzoom & V2D_KEEPASPECT)) { | if ((v2d->keepzoom & V2D_LOCKZOOM_X) == 0 && (v2d->keepzoom & V2D_LOCKZOOM_Y) == 0) { | ||||
| if (U.uiflag & USER_ZOOM_HORIZ) { | if (U.uiflag & USER_ZOOM_HORIZ) { | ||||
| dy = 0; | dy = 0; | ||||
| } | |||||
| else { | |||||
| dx = 0; | |||||
| } | |||||
| } | |||||
| if (fabsf(dx) > fabsf(dy)) { | |||||
| dy = dx; | |||||
| } | } | ||||
| else { | else { | ||||
| dx = 0; | dx = dy; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* support zoom to always zoom entirely - the v2d code uses portrait or | |||||
| * landscape exceptions */ | |||||
| if (v2d->keepzoom & V2D_KEEPASPECT) { | |||||
| if (fabsf(dx) > fabsf(dy)) { | |||||
| dy = dx; | |||||
| } | |||||
| else { | |||||
| dx = dy; | |||||
| } | |||||
| } | |||||
| /* set transform amount, and add current deltas to stored total delta (for redo) */ | /* set transform amount, and add current deltas to stored total delta (for redo) */ | ||||
| RNA_float_set(op->ptr, "deltax", dx); | RNA_float_set(op->ptr, "deltax", dx); | ||||
| RNA_float_set(op->ptr, "deltay", dy); | RNA_float_set(op->ptr, "deltay", dy); | ||||
| Context not available. | |||||