Page MenuHome

2D Pixel Zoom using numpad +/- or mouse wheel scroll
Closed, ResolvedPublic

Description

--- Operating System, Graphics card ---

--- Blender version with error, and version that worked ---
I think Video Sequencer Editor Preview in 2.49 use brecht-s approach.

--- Short description of error ---
This is about 2D Pixel Zoom like in UV/Image Editor.
Using numpad +/- or mouse wheel I cant get exact zoom lvls (1:2, 1:4) as when using numpad "2/4".
Also its imposible when you used numpad "2/4" to change zoom to 1:2 and then get back to exact 1:1 using numpad +/- or mouse wheel.
I think for fine tuning zoom level we have "home" button to fit view and ctrl+3mousebutton hold and scroll for fine zoom.

brecht feedback on irc about using numpad +/- to zoom:
"right now zoom factor is 1.25, could changed to 2^(1/3) so that you end up at 2x after 3 button presses"

Details

Type
To Do

Event Timeline

This is not a bug but a feature request. I think it's a good feature request but it doesn't really belong in the bug tracker. Did a developer ask you to file a report here?

hi Brecht, I asked Czarek to report here so I can tackle after 2.69 (and it doesn't get lost in the mean time).

Brecht Van Lommel (brecht) changed Type from Bug to To Do.
Brecht Van Lommel (brecht) lowered the priority of this task from Normal to Confirmed, Low.

I tried replacing zoom-factor of 0.8 with pow(1.0/2 , 1.0/3).

Next what i did:

  1. Set zoom to 1:4
  2. 3 mouse scroll downs
  3. Set zoom to 1:8

On step 3, i can see a small shake in image. Though it wasn't a surprise. From 1:2 to 1:4 shake is larger.

What should be done to avoid shakes?

PS: I don't know current status of this task. I am sorry if i am redoing a completed work and bothering you.

No one worked on this as far as I know so it's fine.

I didn't notice the jump though. Maybe try printing out sima->zoom and checking if you are actually getting values 0.5, 0.25, 0.125, .. ?

I would say it is perhaps rounding errors, but floats actually can represent these values exactly because they are powers of two.

I tried as you suggested. Following is the dump from console:

8.000001
6.349604
5.039684
4.000000
3.174802
2.519842
2.000000
1.587401
1.259921
1.000000
0.793701
0.629961
0.500000
0.396850
0.314980
0.250000
0.198425
0.157490
0.125000
0.099213
0.078745
Other then 8 all zoom values are exactly correct.

But for zoom-in above 8, I got:
16.000002
32.000004
64.000008
128.000015
256.000031
512.000061
zoom-levels which aren't available directly through menu.

Ok, that's possible if float calculations are imprecise. It could round the value to some number of digits before drawing perhaps.

It's still not clear to me why you would see shaking though, it shows 0.125000 for example so how is setting 1:8 going to make any visual difference?

Sorry for late reply. I got busy with college exams.

Yes, I was wrong then. I tried again. This time I din't noticed any shaking.
I am sorry for it.

If its okay shall I submit a diff ?

Yup, please send a diff and I'll commit it.

I am not able to generate diff through https://developer.blender.org/differential/diff/create/

What i am trying: http://www.pasteall.org/50127

I am using this source code as ref: https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/space_image/image_ops.c%3B8e5b02359b8590ac84afe7a61dd9a6dc67cd632e

I am getting this error: http://www.pasteall.org/50129

I am not able to figure out correct MM in @@-NN,MM NN,MM@@. Whatever I try I am getting "no. of hunk lines" error.

I tried again yesterday for creating diff and i was surprisingly successful this time.

Thx Harshit

patch works well in image editor but VSE preview seems not affected.

@Czarek Kopias (kopias)
Thanks for the feedback.

I thought task was only for Image Editor.
I will do same thing for VSE also.

I forgot to mention that in report. The whole thing for me, besides its more convenient, is to have a way to set half-size in vse preview since there are no menu items there (and numpad shortcuts) like in image editor (talk to DingTo about this and the reason is that zoom factor in VSE preview is inverted so menu zoom factors are disabled there).

P.S. Worth mention in commit log for people who liked old behaviour: ctr+MiddleClickDrag is nice way to zoom fluidly

Brecht Van Lommel (brecht) closed this task as Resolved.Apr 1 2014, 6:04 PM

Committed now, thanks for the patch.