Page MenuHome

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


--- 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"

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) triaged this task as Low priority.Jan 29 2014, 4:45 PM
Brecht Van Lommel (brecht) edited projects, added Quick Hacks; removed BF Blender.
Brecht Van Lommel (brecht) edited a custom field.

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:

Other then 8 all zoom values are exactly correct.

But for zoom-in above 8, I got:
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

What i am trying:

I am using this source code as ref:

I am getting this error:

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) changed the task status from Unknown Status to Resolved.Apr 1 2014, 6:04 PM

Committed now, thanks for the patch.