Skip to content

Commit

Permalink
Fix drawing background on Sonoma
Browse files Browse the repository at this point in the history
  • Loading branch information
praeclarum committed Oct 12, 2023
1 parent e44f230 commit b676146
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 5 additions & 3 deletions Editor/Mac/CEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;

using Foundation;
using CoreGraphics;
using ObjCRuntime;

#if __IOS__
using UIKit;
Expand Down Expand Up @@ -49,10 +51,10 @@ public class CEditor : NativeView, INSTextStorageDelegate, INativeTextViewDelega
NSLayoutConstraint? marginWidthConstraint;

public string Text {
get => textView.TextStorage.Value;
get => textView.TextStorage.Value ?? "";
set {
var val = value ?? "";
var oldText = textView.TextStorage.Value;
var oldText = textView.TextStorage.Value ?? "";
if (oldText == val)
return;
textView.TextStorage.SetString (new NSAttributedString (value ?? "", theme.CommentAttributes));
Expand Down Expand Up @@ -530,7 +532,7 @@ void ColorizeCode (NSTextStorage textStorage)
{
try {

var code = textStorage.Value;
var code = textStorage.Value ?? "";
var managers = textStorage.LayoutManagers;

//
Expand Down
4 changes: 3 additions & 1 deletion Editor/Mac/ErrorView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ public string MessageText {
protected override void DrawDirtyRect (CGRect dirtyRect)
{
NativeColor.Clear.Set ();
NativeGraphics.RectFill (dirtyRect);
var drawRect = Bounds;
drawRect.Intersect (dirtyRect);
NativeGraphics.RectFill (drawRect);

var bounds = Bounds;
if (bounds.Width < bounds.Height)
Expand Down
4 changes: 3 additions & 1 deletion Editor/Mac/MarginView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class MarginView : DrawingView
protected override void DrawDirtyRect (CGRect dirtyRect)
{
Theme.BackgroundColor.Set ();
NativeGraphics.RectFill (dirtyRect);
var drawRect = Bounds;
drawRect.Intersect (dirtyRect);
NativeGraphics.RectFill (drawRect);

var la = Theme.LineNumberAttributes;
var fontHeight = "123".StringSize (la).Height;
Expand Down

0 comments on commit b676146

Please sign in to comment.