diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/TabbedPaneTransferHandler.java b/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/TabbedPaneTransferHandler.java index 2c1f9655..f060ff79 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/TabbedPaneTransferHandler.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/TabbedPaneTransferHandler.java @@ -165,8 +165,8 @@ public class TabbedPaneTransferHandler extends TransferHandler implements DropTa Color color = ui != null ? ui.getDragBorderColor() : tabbedPane.getBackgroundAt(currentTransferable.transferData.tabIndex); Image tabImage = DnDUtil.createDragImage(tabbedPane, currentTransferable.transferData.tabBounds, 2, color); - int w = tabImage.getWidth(null); - int h = tabImage.getHeight(null); + int w = tabImage.getWidth(tabbedPane); + int h = tabImage.getHeight(tabbedPane); setDragImageOffset(new Point(w / 2, h / 2)); setDragImage(tabImage); } diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/TabFrameTransferHandler.java b/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/TabFrameTransferHandler.java index dfc3e706..6a344035 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/TabFrameTransferHandler.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/TabFrameTransferHandler.java @@ -295,8 +295,8 @@ public class TabFrameTransferHandler extends TransferHandler implements DropTarg protected void createDragImage(final TabFrameUI ui) { Component comp = currentTransferable.transferData.tab.getComponent(); Image tabImage = DnDUtil.createDragImage(comp, 2, ui.getDragBorderColor()); - int w = tabImage.getWidth(null); - int h = tabImage.getHeight(null); + int w = tabImage.getWidth(comp); + int h = tabImage.getHeight(comp); setDragImageOffset(new Point(w / 2, h / 2)); setDragImage(tabImage); }