Condition fix in viewport.c