@@ -601,11 +601,10 @@ float dt_dev_get_zoom_scale(dt_dev_viewport_t *port,
601
601
602
602
if (!zoom_scale ) zoom_scale = 1.0f ;
603
603
604
- if (preview && darktable .develop -> preview_pipe -> processed_width )
605
- zoom_scale *= (float )darktable .develop -> full .pipe -> processed_width
606
- / darktable .develop -> preview_pipe -> processed_width ;
604
+ if (preview )
605
+ zoom_scale *= darktable .develop -> preview_pipe -> iscale ;
607
606
608
- return zoom_scale ? zoom_scale : 1.0f ;
607
+ return zoom_scale ;
609
608
}
610
609
611
610
float dt_dev_get_zoom_scale_full (void )
@@ -2871,12 +2870,12 @@ void dt_dev_get_pointer_zoom_pos(dt_dev_viewport_t *port,
2871
2870
dt_dev_get_viewport_params (port , & zoom , & closeup , & zoom2_x , & zoom2_y );
2872
2871
dt_dev_get_processed_size (port , & procw , & proch );
2873
2872
const float scale = dt_dev_get_zoom_scale (port , zoom , 1 <<closeup , FALSE);
2874
- const double tb = port -> border_size ;
2873
+ const float tb = ( float ) port -> border_size ;
2875
2874
// offset from center now (current zoom_{x,y} points there)
2876
- const float mouse_off_x = px - tb - .5 * port -> width ;
2877
- const float mouse_off_y = py - tb - .5 * port -> height ;
2878
- zoom2_x += mouse_off_x / (procw * scale );
2879
- zoom2_y += mouse_off_y / (proch * scale );
2875
+ const float mouse_off_x = px - tb - .5f * port -> width ;
2876
+ const float mouse_off_y = py - tb - .5f * port -> height ;
2877
+ zoom2_x += mouse_off_x / (( float ) procw * scale );
2878
+ zoom2_y += mouse_off_y / (( float ) proch * scale );
2880
2879
* zoom_x = zoom2_x + 0.5f ;
2881
2880
* zoom_y = zoom2_y + 0.5f ;
2882
2881
* zoom_scale = dt_dev_get_zoom_scale (port , zoom , 1 <<closeup , TRUE);
@@ -2897,12 +2896,12 @@ void dt_dev_get_pointer_zoom_pos_from_bounds(dt_dev_viewport_t *port,
2897
2896
dt_dev_get_viewport_params (port , & zoom , & closeup , NULL , NULL );
2898
2897
dt_dev_get_processed_size (port , & procw , & proch );
2899
2898
const float scale = dt_dev_get_zoom_scale (port , zoom , 1 <<closeup , FALSE);
2900
- const double tb = port -> border_size ;
2899
+ const float tb = ( float ) port -> border_size ;
2901
2900
// offset from center now (current zoom_{x,y} points there)
2902
- const float mouse_off_x = px - tb - .5 * port -> width ;
2903
- const float mouse_off_y = py - tb - .5 * port -> height ;
2904
- zoom2_x += mouse_off_x / (procw * scale );
2905
- zoom2_y += mouse_off_y / (proch * scale );
2901
+ const float mouse_off_x = px - tb - .5f * port -> width ;
2902
+ const float mouse_off_y = py - tb - .5f * port -> height ;
2903
+ zoom2_x += mouse_off_x / (( float ) procw * scale );
2904
+ zoom2_y += mouse_off_y / (( float ) proch * scale );
2906
2905
* zoom_x = zoom2_x + 0.5f ;
2907
2906
* zoom_y = zoom2_y + 0.5f ;
2908
2907
* zoom_scale = dt_dev_get_zoom_scale (port , zoom , 1 <<closeup , TRUE);
@@ -2924,8 +2923,8 @@ void dt_dev_get_viewport_params(dt_dev_viewport_t *port,
2924
2923
float pts [2 ] = { port -> zoom_x , port -> zoom_y };
2925
2924
dt_dev_distort_transform_plus (darktable .develop , port -> pipe ,
2926
2925
0.0f , DT_DEV_TRANSFORM_DIR_ALL_GEOMETRY , pts , 1 );
2927
- * x = pts [0 ] / port -> pipe -> processed_width - 0.5f ;
2928
- * y = pts [1 ] / port -> pipe -> processed_height - 0.5f ;
2926
+ * x = pts [0 ] / ( float ) port -> pipe -> processed_width - 0.5f ;
2927
+ * y = pts [1 ] / ( float ) port -> pipe -> processed_height - 0.5f ;
2929
2928
}
2930
2929
dt_pthread_mutex_unlock (& (darktable .control -> global_mutex ));
2931
2930
}
0 commit comments