[graphics] better bounds checking - negative values should be set as 0 and not max -1