index 9e6cd7f50f3dae59ceedf0cfa4569f95b89d6a1b..e6de922405cad9e19e9b0ae863c9139615f438fa 100644 (file)
Transformation::onSwitchPage(GtkNotebookPage */*page*/,
guint pagenum)
{
- updateSelection((PageType)pagenum, sp_desktop_selection(SP_ACTIVE_DESKTOP));
+ updateSelection((PageType)pagenum, sp_desktop_selection(getDesktop()));
}
void
Transformation::updatePageSkew(Inkscape::Selection *selection)
{
if (selection && !selection->isEmpty()) {
- _page_skew.set_sensitive(true);
+ NR::Maybe<NR::Rect> bbox = selection->bounds();
+ if (bbox) {
+ double w = bbox->extent(NR::X);
+ double h = bbox->extent(NR::Y);
+ _scalar_skew_vertical.setHundredPercent(w);
+ _scalar_skew_horizontal.setHundredPercent(h);
+ _page_skew.set_sensitive(true);
+ } else {
+ _page_skew.set_sensitive(false);
+ }
} else {
_page_skew.set_sensitive(false);
}
break;
}
case PAGE_SCALE: {
- _scalar_scale_horizontal.setValue(100);
- _scalar_scale_vertical.setValue(100);
+ _scalar_scale_horizontal.setValue(100, "%");
+ _scalar_scale_vertical.setValue(100, "%");
break;
}
case PAGE_SKEW: {