* there were no sufficient information to calculate dpi.
* so it's considerable to re-calculate e_scale with output geometry.
*/
- e_scale_manual_update(((e->w * 254 / e->phys_width) + 5) / 10);
+ double target_inch;
+ int dpi;
+
+ target_inch = (round((sqrt(e->phys_width * e->phys_width + e->phys_height * e->phys_height) / 25.4) * 10) / 10);
+ dpi = (round((sqrt(e->w * e->w + e->h * e->h) / target_inch) * 10) / 10);
+
+ e_scale_manual_update(dpi);
end:
return ECORE_CALLBACK_PASS_ON;
tdm_display *tdisplay = e_comp_screen->tdisplay;
int num_outputs;
int i;
+ Eina_Bool scale_updated = EINA_FALSE;
/* init e_output */
if (!e_output_init())
ERR("fail to e_output_dpms.");
goto fail;
}
+
+ /* update e_scale with first available output size */
+ if ((e_config->scale.for_tdm) && (!scale_updated))
+ {
+ double target_inch;
+ int dpi;
+
+ target_inch = (round((sqrt(output->info.size.w * output->info.size.w + output->info.size.h * output->info.size.h) / 25.4) * 10) / 10);
+ dpi = (round((sqrt(mode->w * mode->w + mode->h * mode->h) / target_inch) * 10) / 10);
+
+ e_scale_manual_update(dpi);
+ scale_updated = EINA_TRUE;
+ }
}
//TODO: if there is no output connected, make the fake output which is connected.
E_CONFIG_VAL(D, T, scale.min, DOUBLE);
E_CONFIG_VAL(D, T, scale.max, DOUBLE);
E_CONFIG_VAL(D, T, scale.factor, DOUBLE);
+ E_CONFIG_VAL(D, T, scale.profile_factor, DOUBLE);
+ E_CONFIG_VAL(D, T, scale.inch_correction, DOUBLE);
+ E_CONFIG_VAL(D, T, scale.inch_correction_bound, DOUBLE);
E_CONFIG_VAL(D, T, scale.base_dpi, INT);
E_CONFIG_VAL(D, T, scale.use_dpi, UCHAR);
E_CONFIG_VAL(D, T, scale.use_custom, UCHAR);
+ E_CONFIG_VAL(D, T, scale.for_tdm, UCHAR);
E_CONFIG_VAL(D, T, show_cursor, UCHAR);
E_CONFIG_VAL(D, T, idle_cursor, UCHAR);
E_CONFIG_LIST(D, T, env_vars, _e_config_env_var_edd);
double min;
double max;
double factor;
+ double profile_factor;
+ double inch_correction;
+ double inch_correction_bound;
int base_dpi;
unsigned char use_dpi;
unsigned char use_custom;
+ unsigned char for_tdm;
} scale;
unsigned char show_cursor;
unsigned char idle_cursor;
if (e_config->scale.use_dpi)
{
+ double profile_factor = 1.0;
+ double inch = 0.0;
+
+ if (e_config->scale.profile_factor > 0.0)
+ {
+ if (e_config->scale.inch_correction > 0.0)
+ {
+ inch = floor(sqrt((e_comp->w * e_comp->w) + (e_comp->h * e_comp->h)) / BASE_DPI * 10 + 0.5) / 10;
+
+ if (inch <= e_config->scale.inch_correction_bound)
+ profile_factor = e_config->scale.profile_factor;
+ else
+ profile_factor = e_config->scale.profile_factor + e_config->scale.inch_correction;
+ }
+ else
+ profile_factor = e_config->scale.profile_factor;
+ }
+
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
- e_scale = (double)BASE_DPI / (double)e_config->scale.base_dpi;
+ e_scale = floor((double)BASE_DPI * profile_factor / (double)e_config->scale.base_dpi * 10 + 0.5) / 10;
if (e_scale > e_config->scale.max) e_scale = e_config->scale.max;
else if (e_scale < e_config->scale.min)
e_scale_manual_update(int dpi)
{
char buf[128];
+ double profile_factor = 1.0;
+ double inch = 0.0;
if (!_initted)
{
return;
}
- e_scale = (double)dpi / (double)e_config->scale.base_dpi;
+ if (e_config->scale.profile_factor > 0.0)
+ {
+ if (e_config->scale.inch_correction > 0.0)
+ {
+ inch = floor(sqrt((e_comp->w * e_comp->w) + (e_comp->h * e_comp->h)) / dpi * 10 + 0.5) / 10;
+
+ if (inch <= e_config->scale.inch_correction_bound)
+ profile_factor = e_config->scale.profile_factor;
+ else
+ profile_factor = e_config->scale.profile_factor + e_config->scale.inch_correction;
+ }
+ else
+ profile_factor = e_config->scale.profile_factor;
+ }
+
+ e_scale = floor((double)dpi * profile_factor / (double)e_config->scale.base_dpi * 10 + 0.5) / 10;
if (e_scale > e_config->scale.max) e_scale = e_config->scale.max;
else if (e_scale < e_config->scale.min)