2D Pixel Zoom using numpad +/- or mouse wheel scroll #36916

Closed
opened 2013-10-02 00:58:01 +02:00 by Cezary Kopias · 17 comments

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

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

Changed status to: 'Open'

Changed status to: 'Open'

%%%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?%%%

%%%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).%%%

%%%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).%%%

Added subscriber: @Harshit-3

Added subscriber: @Harshit-3

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.

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.

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.

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?

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 ?

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.

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

image_ops_zoom_factor.diff

I tried again yesterday for creating diff and i was surprisingly successful this time. [image_ops_zoom_factor.diff](https://archive.blender.org/developer/F80965/image_ops_zoom_factor.diff)
Author

Thx Harshit

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

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

@kopias
Thanks for the feedback.

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

@kopias Thanks for the feedback. I thought task was only for Image Editor. I will do same thing for VSE also.
Author

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

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

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Committed now, thanks for the patch.

Committed now, thanks for the patch.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#36916
No description provided.