update_preview = TRUE;
}
-void
+G_MODULE_EXPORT void
display_height_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
g_debug("display_height_changed_cb ()");
update_preview = TRUE;
}
-void
+G_MODULE_EXPORT void
scale_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
g_debug("scale_changed_cb ()");
gtk_label_set_text (GTK_LABEL(widget), text);
}
+G_MODULE_EXPORT void
+show_crop_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
+{
+ g_debug("show_crop_changed_cb ()");
+ ghb_widget_to_setting(ud->settings, widget);
+ ghb_check_dependency(ud, widget);
+ ghb_live_reset(ud);
+ if (GTK_WIDGET_SENSITIVE(widget))
+ ghb_set_scale (ud, 0);
+ update_preview = TRUE;
+}
+
G_MODULE_EXPORT void
generic_entry_changed_cb(GtkEntry *entry, signal_user_data_t *ud)
{
<property name="can_focus">True</property>
<property name="tooltip-text" translatable="yes">Show Cropped area of the preview</property>
<property name="label" translatable="yes">Show Crop</property>
- <signal name="toggled" handler="scale_changed_cb"/>
+ <signal name="toggled" handler="show_crop_changed_cb"/>
</object>
<packing>
<property name="expand">False</property>
job->height = ghb_settings_get_int(settings, "scale_height");
if (ghb_settings_get_boolean(settings, "show_crop"))
{
+ gdouble xscale = (gdouble)job->width /
+ (gdouble)(job->title->width - job->crop[2] - job->crop[3]);
+ gdouble yscale = (gdouble)job->height /
+ (gdouble)(job->title->height - job->crop[0] - job->crop[1]);
+
+ job->width += xscale * (job->crop[2] + job->crop[3]);
+ job->height += yscale * (job->crop[0] + job->crop[1]);
job->crop[0] = 0;
job->crop[1] = 0;
job->crop[2] = 0;
job->crop[3] = 0;
- job->width = job->title->width;
- job->height = job->title->height;
job->anamorphic.modulus = 2;
}