static void nova_center_update (GtkWidget *widget, NovaCenter *center, gint x, gint y) { gint tx, ty; GimpPreviewArea *area = GIMP_PREVIEW_AREA (center->preview->area); GtkAllocation allocation; gtk_widget_get_allocation (GTK_WIDGET (area), &allocation); x -= (allocation.width - area->width) / 2; y -= (allocation.height - area->height) / 2; gimp_preview_untransform (center->preview, x, y, &tx, &ty); g_signal_handlers_block_by_func (center->coords, nova_center_coords_update, center); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (center->coords), 0, tx); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (center->coords), 1, ty); g_signal_handlers_unblock_by_func (center->coords, nova_center_coords_update, center); nova_center_coords_update (GIMP_SIZE_ENTRY (center->coords), center); gtk_widget_queue_draw (center->preview->area); }
static gboolean nova_center_update (GtkWidget *widget, NovaCenter *center, gint x, gint y) { gint tx, ty; gimp_preview_untransform (center->preview, x, y, &tx, &ty); nova_center_cursor_draw (center); g_signal_handlers_block_by_func (center->coords, nova_center_coords_update, center); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (center->coords), 0, tx); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (center->coords), 1, ty); g_signal_handlers_unblock_by_func (center->coords, nova_center_coords_update, center); nova_center_coords_update (GIMP_SIZE_ENTRY (center->coords), center); return TRUE; }