1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-14 14:24:10 +02:00

Squiggle fix for non-default font, manually add method fix

This commit is contained in:
Brian Fiete 2019-09-30 12:23:27 -07:00
parent e43beb5794
commit 69e3bf94f7
4 changed files with 15 additions and 11 deletions

View file

@ -3487,7 +3487,7 @@ namespace IDE
public void Cmd_ZoomOut() public void Cmd_ZoomOut()
{ {
float scale = DarkTheme.sScale; float scale = DarkTheme.sScale;
if (scale > 0.30f) if (scale > 0.25f)
{ {
if (scale < 0) if (scale < 0)
scale -= 0.05f; scale -= 0.05f;
@ -6559,7 +6559,7 @@ namespace IDE
public void SetScale(float scale, bool force = false) public void SetScale(float scale, bool force = false)
{ {
var prevScale = DarkTheme.sScale; var prevScale = DarkTheme.sScale;
float useScale = Math.Clamp(scale, 0.25f, 4.0f); float useScale = Math.Clamp(scale, 0.5f, 4.0f);
if ((prevScale == useScale) && (!force)) if ((prevScale == useScale) && (!force))
return; return;
@ -10069,7 +10069,7 @@ namespace IDE
UpdateRecentFileMenuItems(); UpdateRecentFileMenuItems();
ShowStartupFile(); ShowStartupFile();
if (mIsFirstRun) if ((mIsFirstRun) && (!mWorkspace.IsInitialized))
ShowWelcome(); ShowWelcome();
} }
#endif #endif
@ -11985,19 +11985,19 @@ namespace IDE
Image squiggleImage = IDEApp.sApp.mSquiggleImage; Image squiggleImage = IDEApp.sApp.mSquiggleImage;
int32 segSize = 30; int32 segSize = 30;
float height = mSquiggleImage.mHeight; float height = mSquiggleImage.mHeight;
//int32 segSize = GS!(6 * 5);
float curX = x; float curX = x;
float curWidth = width; float curWidth = width;
float drawY = y + gApp.mCodeFont.GetHeight();
while (curWidth > 0) while (curWidth > 0)
{ {
float drawWidth = Math.Min(curWidth, segSize - (curX % segSize)); float drawWidth = Math.Min(curWidth, segSize - (curX % segSize));
float u1 = ((int32)curX % segSize) / (float)squiggleImage.mSrcWidth; float u1 = ((int32)curX % segSize) / (float)squiggleImage.mSrcWidth;
float u2 = u1 + drawWidth / (float)squiggleImage.mSrcWidth; float u2 = u1 + drawWidth / (float)squiggleImage.mSrcWidth;
g.DrawQuad(squiggleImage, curX, y + (int)GS!(15), u1, 0, drawWidth, height, u2, 1.0f); g.DrawQuad(squiggleImage, curX, drawY, u1, 0, drawWidth, height, u2, 1.0f);
curWidth -= drawWidth; curWidth -= drawWidth;
curX += drawWidth; curX += drawWidth;

View file

@ -474,7 +474,8 @@ namespace IDE
} }
mChildItems.Insert(index, item); mChildItems.Insert(index, item);
mChildMap.Add(item.mName, item); bool added = mChildMap.TryAdd(item.mName, item);
Debug.Assert(added);
} }
public virtual void InsertChild(ProjectItem item, ProjectItem insertBefore) public virtual void InsertChild(ProjectItem item, ProjectItem insertBefore)
@ -544,7 +545,7 @@ namespace IDE
data.Add("Type", (mIncludeKind == .Ignore) ? "IgnoreFolder" : "Folder"); data.Add("Type", (mIncludeKind == .Ignore) ? "IgnoreFolder" : "Folder");
base.Serialize(data); base.Serialize(data);
if (mAutoInclude != (mIncludeKind == .Auto)) if (mAutoInclude != (mIncludeKind == .Auto))
data.ConditionalAdd("AutoInclude", mAutoInclude, true); data.ConditionalAdd("AutoInclude", mAutoInclude, mIncludeKind == .Auto);
} }
if (!mChildItems.IsEmpty) if (!mChildItems.IsEmpty)
{ {
@ -593,7 +594,7 @@ namespace IDE
bool doPopulate = false; bool doPopulate = false;
bool autoInclude = data.GetBool("AutoInclude", true); bool autoInclude = data.GetBool("AutoInclude", mIncludeKind == .Auto);
if ((autoInclude) && (!mAutoInclude)) if ((autoInclude) && (!mAutoInclude))
doPopulate = true; doPopulate = true;
mAutoInclude = autoInclude; mAutoInclude = autoInclude;

View file

@ -449,6 +449,9 @@ namespace IDE.ui
continue; continue;
} }
if (!projectFolder.mAutoInclude)
continue;
let ext = scope String(); let ext = scope String();
Path.GetExtension(fileName, ext); Path.GetExtension(fileName, ext);

View file

@ -642,7 +642,7 @@ namespace IDE.ui
if (underlineColor != 0) if (underlineColor != 0)
{ {
using (g.PushColor(underlineColor)) using (g.PushColor(underlineColor))
IDEApp.sApp.DrawSquiggle(g, x, y, width); gApp.DrawSquiggle(g, x, y, width);
} }
} }
} }