Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2004-06-04 09:20:29 -0400
committerAndre Weinand2004-06-04 09:20:29 -0400
commitf3244886d6d75685cd9181eaf63ebb298526c423 (patch)
tree2d94643382283ea9a26a4adae4ecb8dee4d97714 /bundles/org.eclipse.compare/compare
parentdf425d4e41cde783b8009606ced4e18d633023ca (diff)
downloadeclipse.platform.team-f3244886d6d75685cd9181eaf63ebb298526c423.tar.gz
eclipse.platform.team-f3244886d6d75685cd9181eaf63ebb298526c423.tar.xz
eclipse.platform.team-f3244886d6d75685cd9181eaf63ebb298526c423.zip
fixed #55333v20040604_1600
Diffstat (limited to 'bundles/org.eclipse.compare/compare')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index b69826cef..9c8271f22 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -3509,11 +3509,17 @@ public class TextMergeViewer extends ContentMergeViewer {
}
static RGB interpolate(RGB fg, RGB bg, double scale) {
- return new RGB(
- (int)((1.0-scale) * fg.red + scale * bg.red),
- (int)((1.0-scale) * fg.green + scale * bg.green),
- (int)((1.0-scale) * fg.blue + scale * bg.blue)
- );
+ if (fg != null && bg != null)
+ return new RGB(
+ (int)((1.0-scale) * fg.red + scale * bg.red),
+ (int)((1.0-scale) * fg.green + scale * bg.green),
+ (int)((1.0-scale) * fg.blue + scale * bg.blue)
+ );
+ if (fg != null)
+ return fg;
+ if (bg != null)
+ return bg;
+ return new RGB(128, 128, 128); // a gray
}
//---- Navigating and resolving Diffs

Back to the top