mmanela / diffplex

DiffPlex is Netstandard 1.0+ C# library to generate textual diffs.
Apache License 2.0
990 stars 183 forks source link

No text showing in windows forms #99

Open beauholland opened 1 year ago

beauholland commented 1 year ago

Similar to: https://github.com/mmanela/diffplex/issues/79

screenshot

Visual Studio 2022

Targeting .Net 6.0

Windows Forms

DiffPlex.Wpf 1.3.2

Tried modifying font, fore/back colors - no luck

Tested in another older project targeting .Net 4.6.1 - same behaviour

Repo replicating the issue here: https://github.com/beauholland/diffplexwinformstest

beauholland commented 1 year ago

Finally figured it out.

Default ForeColor is Alpha'd out, set to: Color.FromArgb(0, 0, 0, 0) which is transparent.

Update the ForeColor to:

diffViewer1.ForeColor = Color.FromArgb(255, 0, 0, 0); OR

(0, 0, 0); in properties

Setting the .ForeColor is NOT enough given the other Fore Colors for things like Unchanged, Inserted etc are all set at (0, 0, 0, 0), and are still transparent

Therefore you need to update all the (0, 0, 0, 0) to at least (255, 0, 0, 0) or (0, 0, 0) - no alpha