mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[diff/merge] Fix divider polygons alignment for the short diff.
Use a separate value for the short diff and for the full diff.
This commit is contained in:
@@ -77,7 +77,6 @@ import java.util.List;
|
||||
|
||||
public class DiffPanelImpl implements DiffPanelEx, ContentChangeListener, TwoSidesContainer {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.diff.impl.DiffPanelImpl");
|
||||
public static final int DIFF_DIVIDER_POLYGONS_OFFSET = 3;
|
||||
|
||||
private final DiffSplitterI mySplitter;
|
||||
private final DiffPanelOuterComponent myPanel;
|
||||
@@ -111,7 +110,7 @@ public class DiffPanelImpl implements DiffPanelEx, ContentChangeListener, TwoSid
|
||||
private CanNotCalculateDiffPanel myNotCalculateDiffPanel;
|
||||
private final VisibleAreaListener myVisibleAreaListener;
|
||||
|
||||
public DiffPanelImpl(final Window owner, Project project, boolean enableToolbar, boolean horizontal) {
|
||||
public DiffPanelImpl(final Window owner, Project project, boolean enableToolbar, boolean horizontal, int diffDividerPolygonsOffset) {
|
||||
myProject = project;
|
||||
myIsHorizontal = horizontal;
|
||||
myOptions = new DiffPanelOptions(this);
|
||||
@@ -130,7 +129,7 @@ public class DiffPanelImpl implements DiffPanelEx, ContentChangeListener, TwoSid
|
||||
|
||||
if (horizontal) {
|
||||
mySplitter = new DiffSplitter(myLeftSide.getComponent(), myRightSide.getComponent(),
|
||||
new DiffDividerPaint(this, FragmentSide.SIDE1, DIFF_DIVIDER_POLYGONS_OFFSET), myData);
|
||||
new DiffDividerPaint(this, FragmentSide.SIDE1, diffDividerPolygonsOffset), myData);
|
||||
}
|
||||
else {
|
||||
mySplitter = new HorizontalDiffSplitter(myLeftSide.getComponent(), myRightSide.getComponent());
|
||||
|
||||
+2
-1
@@ -38,6 +38,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class DiffManagerImpl extends DiffManager implements JDOMExternalizable {
|
||||
public static final int FULL_DIFF_DIVIDER_POLYGONS_OFFSET = 3;
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.diff.impl.external.DiffManagerImpl");
|
||||
|
||||
private static final Externalizer<String> TOOL_PATH_UPDATE = new Externalizer<String>() {
|
||||
@@ -137,7 +138,7 @@ public class DiffManagerImpl extends DiffManager implements JDOMExternalizable {
|
||||
}
|
||||
|
||||
public DiffPanel createDiffPanel(Window window, Project project) {
|
||||
return new DiffPanelImpl(window, project, true, true);
|
||||
return new DiffPanelImpl(window, project, true, true, FULL_DIFF_DIVIDER_POLYGONS_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-1
@@ -79,6 +79,8 @@ import java.util.List;
|
||||
* Time: 4:00 PM
|
||||
*/
|
||||
public class ChangesFragmentedDiffPanel implements Disposable {
|
||||
private static final int SHORT_DIFF_DIVIDER_POLYGONS_OFFSET = 2;
|
||||
|
||||
private final JPanel myPanel;
|
||||
private final Project myProject;
|
||||
private final JComponent myParent;
|
||||
@@ -346,7 +348,7 @@ public class ChangesFragmentedDiffPanel implements Disposable {
|
||||
}
|
||||
|
||||
private DiffPanel createPanel(final boolean horizontal) {
|
||||
final DiffPanel diffPanel = new DiffPanelImpl(null, myProject, false, horizontal){
|
||||
final DiffPanel diffPanel = new DiffPanelImpl(null, myProject, false, horizontal, SHORT_DIFF_DIVIDER_POLYGONS_OFFSET){
|
||||
@Override
|
||||
protected DiffPanelState createDiffPanelState(@NotNull Disposable parentDisposable) {
|
||||
return new FragmentedDiffPanelState(this, myProject, ! horizontal, parentDisposable);
|
||||
|
||||
Reference in New Issue
Block a user