public boolean isInView (int marginx, int marginy) {
        if (!getTileBBox(temp_bbox_copy)) {
            temp_bbox_copy.x = (int) x;
            temp_bbox_copy.y = (int) y;
            temp_bbox_copy.width = 0;
            temp_bbox_copy.height = 0;
        }
        if (temp_bbox_copy.x + temp_bbox_copy.width < viewxofs - marginx)
            return false;
        if (temp_bbox_copy.y + temp_bbox_copy.height < viewyofs - marginy)
            return false;
        if (temp_bbox_copy.x > viewxofs + viewwidth + marginx)
            return false;
        if (temp_bbox_copy.y > viewyofs + viewheight + marginy)
            return false;
        return true;
    }