Properly pad images that are the same size as the 'best' cursor size in
only one dimension. git-svn-id: https://samskivert.googlecode.com/svn/trunk@830 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: DnDManager.java,v 1.9 2002/09/06 17:41:41 ray Exp $
|
// $Id: DnDManager.java,v 1.10 2002/09/06 17:46:29 ray Exp $
|
||||||
|
|
||||||
package com.samskivert.swing.dnd;
|
package com.samskivert.swing.dnd;
|
||||||
|
|
||||||
@@ -80,7 +80,10 @@ public class DnDManager
|
|||||||
", bestSize=" + d.width + "x" + d.height +
|
", bestSize=" + d.width + "x" + d.height +
|
||||||
", maxcolors=" + colors + "].");
|
", maxcolors=" + colors + "].");
|
||||||
|
|
||||||
if ((w < d.width) && (h < d.height)) {
|
// if the passed-in image is smaller, pad it with transparent pixels
|
||||||
|
// and use it anyway.
|
||||||
|
if (((w < d.width) && (h <= d.height)) ||
|
||||||
|
((w <= d.width) && (h < d.height))) {
|
||||||
Image padder = GraphicsEnvironment.getLocalGraphicsEnvironment().
|
Image padder = GraphicsEnvironment.getLocalGraphicsEnvironment().
|
||||||
getDefaultScreenDevice().getDefaultConfiguration().
|
getDefaultScreenDevice().getDefaultConfiguration().
|
||||||
createCompatibleImage(d.width, d.height, Transparency.BITMASK);
|
createCompatibleImage(d.width, d.height, Transparency.BITMASK);
|
||||||
|
|||||||
Reference in New Issue
Block a user