Issue #1208 change density and mag handlers in d2d to not throw exceptions.

Former-commit-id: f20812bc11 [formerly f20812bc11 [formerly b7c0ef15d9e8c27cd3ce646b393c6c44315eabef]]
Former-commit-id: 3f4bfb8efe
Former-commit-id: 6e8bca348f
This commit is contained in:
Ben Steffensmeier 2012-09-21 11:11:24 -05:00
parent 8fc544b44f
commit 4372a4e0d6
2 changed files with 4 additions and 3 deletions

View file

@ -81,7 +81,7 @@ public class DensityHandler extends AbstractHandler implements IElementUpdater {
IDisplayPane[] panes = container.getDisplayPanes();
for (IDisplayPane pane : panes) {
IRenderableDisplay disp = pane.getRenderableDisplay();
if (disp != null) {
if (disp != null && disp instanceof ID2DRenderableDisplay) {
((ID2DRenderableDisplay) disp).setDensity(density);
}
}

View file

@ -73,11 +73,12 @@ public class MagHandler extends AbstractHandler implements IElementUpdater {
double magnification = Double.parseDouble((arg0
.getParameter("magnification")));
if (editor != null) {
if (magnification == 0.0f) magnification=0.1;
if (magnification == 0.0f)
magnification = 0.1;
IDisplayPane[] panes = editor.getDisplayPanes();
for (IDisplayPane pane : panes) {
IRenderableDisplay disp = pane.getRenderableDisplay();
if (disp != null) {
if (disp != null && disp instanceof ID2DRenderableDisplay) {
((ID2DRenderableDisplay) disp)
.setMagnification(magnification);
}