Browse Source

REPORT-92439 mac下-展开收起图标的问题

release/11.0
obo 2 years ago
parent
commit
8ac5a7e5ea
  1. 9
      designer-base/src/main/java/com/fr/base/svg/SVGIcon.java
  2. 10
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java
  3. 37
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java
  4. 9
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

9
designer-base/src/main/java/com/fr/base/svg/SVGIcon.java

@ -1,6 +1,6 @@
package com.fr.base.svg;
import com.fr.design.utils.SvgPainter;
import com.fr.design.utils.SvgPaintUtils;
import com.fr.general.IOUtils;
import javax.swing.Icon;
@ -37,12 +37,7 @@ public class SVGIcon implements Icon {
public void paintIcon(Component c, Graphics g, int x, int y) {
if (HI_DPI_SURPORT) {
Graphics2D graphics = (Graphics2D) g.create(x, y, image.getWidth(null), image.getHeight(null));
new SvgPainter(graphics) {
@Override
protected void doPaint() {
this.drawImage(image, 0, 0, null);
}
}.paint();
SvgPaintUtils.doDrawSVG(graphics, () -> SvgPaintUtils.drawImage(graphics, image, 0, 0, null));
graphics.dispose();
} else {
g.drawImage(image, x, y, null);

10
designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java

@ -5,7 +5,7 @@ import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.SvgPainter;
import com.fr.design.utils.SvgPaintUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.JComponent;
@ -337,13 +337,7 @@ public class UIEastResizableContainer extends JPanel {
button = UIConstants.DRAG_RIGHT_PRESS;
}
}
//如果环境支持高清化,在调整缩放比例时绘制svg会影响到位置的变化,若图标无确定裁剪位置,则需要进行调整
new SvgPainter(g) {
@Override
protected void doPaint() {
this.drawImage(button, 10, 7, null);
}
}.paint();
SvgPaintUtils.doDrawSVG(g, () -> SvgPaintUtils.drawImage(g, button, 10, 7, null));
}
}
}

37
designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -3,7 +3,7 @@ package com.fr.design.gui.icontainer;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.SvgPainter;
import com.fr.design.utils.SvgPaintUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.Constants;
@ -421,24 +421,9 @@ public class UIResizableContainer extends JPanel {
Image upButton = (upModel == UIConstants.MODEL_NORMAL ? UIConstants.DRAG_UP_NORMAL : UIConstants.DRAG_UP_PRESS);
Image downButton = (downModel == UIConstants.MODEL_NORMAL ? UIConstants.DRAG_DOWN_NORMAL : UIConstants.DRAG_DOWN_PRESS);
g.drawImage(UIConstants.DRAG_BAR_LIGHT, 0, 0, getWidth(), getHeight(), null);
new SvgPainter(g) {
@Override
protected void doPaint() {
this.drawImage(UIConstants.DRAG_LINE, (getWidth() - toolPaneHeight) / 2, 3, null);
}
}.paint();
new SvgPainter(g) {
@Override
protected void doPaint() {
this.drawImage(upButton, ARROW_MARGIN, 0, null);
}
}.paint();
new SvgPainter(g) {
@Override
protected void doPaint() {
this.drawImage(downButton, (getWidth() - toolPaneHeight - ARROW_MARGIN), 0, null);
}
}.paint();
SvgPaintUtils.doDrawSVG(g, () -> SvgPaintUtils.drawImage(g, UIConstants.DRAG_LINE, (getWidth() - toolPaneHeight) / 2, 3, null));
SvgPaintUtils.doDrawSVG(g, () -> SvgPaintUtils.drawImage(g, upButton, ARROW_MARGIN, 0, null));
SvgPaintUtils.doDrawSVG(g, () -> SvgPaintUtils.drawImage(g, downButton, (getWidth() - toolPaneHeight - ARROW_MARGIN), 0, null));
}
}
@ -535,12 +520,7 @@ public class UIResizableContainer extends JPanel {
button = UIConstants.DRAG_LEFT_PRESS;
}
}
new SvgPainter(g) {
@Override
protected void doPaint() {
this.drawImage(button, -6, ARROW_MARGIN_VERTICAL, VerticalToolPane.this);
}
}.paint();
SvgPaintUtils.doDrawSVG(g, () -> SvgPaintUtils.drawImage(g, button, -6, ARROW_MARGIN_VERTICAL, VerticalToolPane.this));
} else {
g.drawImage(UIConstants.DRAG_BAR_LIGHT, 0, 0, toolPaneHeight, getHeight(), null);
if (containerWidth == toolPaneHeight) {
@ -556,12 +536,7 @@ public class UIResizableContainer extends JPanel {
button = UIConstants.DRAG_RIGHT_PRESS;
}
}
new SvgPainter(g) {
@Override
protected void doPaint() {
this.drawImage(button, 10, ARROW_MARGIN_VERTICAL, VerticalToolPane.this);
}
}.paint();
SvgPaintUtils.doDrawSVG(g, () -> SvgPaintUtils.drawImage(g, button, 10, ARROW_MARGIN_VERTICAL, VerticalToolPane.this));
}
if (isLeftRightDragEnabled) {
g.drawImage(UIConstants.DRAG_DOT_VERTICAL, 2, getHeight() / 2, 5, toolPaneHeight, null);

9
designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

@ -19,7 +19,7 @@ import com.fr.design.notification.SnapChat;
import com.fr.design.notification.SnapChatFactory;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.SvgPainter;
import com.fr.design.utils.SvgPaintUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.log.FineLoggerFactory;
@ -1314,12 +1314,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
} else {
button = UIConstants.POP_BUTTON_UP;
}
new SvgPainter(g) {
@Override
protected void doPaint() {
this.drawImage(button, (ARROW_RANGE_START + 8), 4, null);
}
}.paint();
SvgPaintUtils.doDrawSVG(g, () -> SvgPaintUtils.drawImage(g, button, (ARROW_RANGE_START + 8), 4, null));
}
}

Loading…
Cancel
Save