mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed garbled stripe button drag image
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -184,8 +184,14 @@ public final class StripeButton extends AnchoredButton implements ActionListener
|
||||
|
||||
myDragPane = findLayeredPane(e);
|
||||
if (myDragPane == null) return;
|
||||
final BufferedImage image = UIUtil.createImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_ARGB);
|
||||
paint(image.getGraphics());
|
||||
int width = getWidth() - 1; // -1 because StripeButtonUI.paint will not paint 1 pixel in case (anchor == ToolWindowAnchor.LEFT)
|
||||
int height = getHeight() - 1; // -1 because StripeButtonUI.paint will not paint 1 pixel in case (anchor.isHorizontal())
|
||||
BufferedImage image = UIUtil.createImage(width, height, BufferedImage.TYPE_INT_RGB);
|
||||
Graphics graphics = image.getGraphics();
|
||||
graphics.setColor(UIUtil.getBgFillColor(getParent()));
|
||||
graphics.fillRect(0, 0, width, height);
|
||||
paint(graphics);
|
||||
graphics.dispose();
|
||||
myDragButtonImage = new JLabel(new JBImageIcon(image)) {
|
||||
|
||||
public String toString() {
|
||||
|
||||
Reference in New Issue
Block a user