: -minorSpace * (double) tickRect.height / (max - min);
: -minorSpace * (double) (tickRect.height - 1) / (max - min);
  public void paintTicks(Graphics g)  {    int max = slider.getMaximum();    int min = slider.getMinimum();    int majorSpace = slider.getMajorTickSpacing();    int minorSpace = slider.getMinorTickSpacing();    if (majorSpace > 0)      {	if (slider.getOrientation() == JSlider.HORIZONTAL)	  {	    double loc = tickRect.x;	    double increment = (max == min) ? 0	                                 : majorSpace * (double) tickRect.width / (max	                                 - min);	    if (drawInverted())	      {		loc += tickRect.width;		increment *= -1;	      }	    for (int i = min; i <= max; i += majorSpace)	      {		paintMajorTickForHorizSlider(g, tickRect, (int) loc);		loc += increment;	      }	  }	else	  {	    double loc = tickRect.height + tickRect.y;	    double increment = (max == min) ? 0	                                 : -majorSpace * (double) tickRect.height / (max	                                 - min);	    if (drawInverted())	      {		loc = tickRect.y;		increment *= -1;	      }	    for (int i = min; i <= max; i += majorSpace)	      {		paintMajorTickForVertSlider(g, tickRect, (int) loc);		loc += increment;	      }	  }      }    if (minorSpace > 0)      {	if (slider.getOrientation() == JSlider.HORIZONTAL)	  {	    double loc = tickRect.x;	    double increment = (max == min) ? 0	                                 : minorSpace * (double) tickRect.width / (max	                                 - min);	    if (drawInverted())	      {		loc += tickRect.width;		increment *= -1;	      }	    for (int i = min; i <= max; i += minorSpace)	      {		paintMinorTickForHorizSlider(g, tickRect, (int) loc);		loc += increment;	      }	  }	else	  {	    double loc = tickRect.height + tickRect.y;	    double increment = (max == min) ? 0	                                 : -minorSpace * (double) tickRect.height / (max	                                 - min);	    if (drawInverted())	      {		loc = tickRect.y;		increment *= -1;	      }	    for (int i = min; i <= max; i += minorSpace)	      {		paintMinorTickForVertSlider(g, tickRect, (int) loc);		loc += increment;	      }	  }      }  }