WidgetViewport vp = new WidgetViewport();
WidgetViewRectangle vp = new WidgetViewRectangle();
    public void calcViewport(Widget w) {        WidgetViewport vp = new WidgetViewport();        if (!w.isVisible()) {            w.setViewport(vp);            return;        }        WidgetBoundingRectangle visiRect = calcVisiblityRect(w);        ((Spatial) w).updateWorldBound();        WidgetBoundingRectangle r =            new WidgetBoundingRectangle((WidgetBoundingRectangle) ((Spatial) w).getWorldBound(), true);        if (visiRect != null) {            if (visiRect.contains(r) || WidgetBoundingRectangle.intersects(visiRect, r)) {                WidgetBoundingRectangle clipped = WidgetBoundingRectangle.clip(r, visiRect);                vp.set(clipped);                if (w.isApplyOffsetX() && r.getMinX() < visiRect.getMinX()) {//					vp.setMinX(clipped.getMinX());//					vp.setMaxX(clipped.getMaxX());					vp.setOffsetX(r.getMinX() - visiRect.getMinX());					                } else {//					vp.setMinX(r.getMinX());//					vp.setMaxX(r.getMaxX());                }                if (w.isApplyOffsetY() && r.getMinY() < visiRect.getMinY()) {//					vp.setMinY(clipped.getMinY());//					vp.setMaxY(clipped.getMaxY());					vp.setOffsetY(r.getMinY() - visiRect.getMinY());				} else {//					vp.setMinY(r.getMinY());//					vp.setMaxY(r.getMaxY());				}            }        } else {            vp.set(r);        }        w.setViewport(vp);    }