code: private void setLimits(Surface surface, int gridH, int gridV)
      {
          Check.notNull(surface);
  
          if (gridH == 0)
          {
              limitRight = 0;
          }
          else
          {
              limitRight = Math.max(0, surface.getWidth() - UtilMath.getRounded(width, gridH));
          }
          if (gridV == 0)
          {
              limitTop = 0;
          }
          else
          {
              limitTop = Math.max(0, surface.getHeight() - UtilMath.getRounded(height, gridV));
          }
          limitLeft = 0;
          limitBottom = 0;
  
          moveLocation(1.0, 0.0, 0.0);
      }
docs: Define the maximum view limit.
  
  @param surface The surface reference.
  @param gridH The horizontal grid.
  @param gridV The vertical grid.
  @throws LionEngineException If <code>null</code> surface.