Skip to content

Commit 7be1f50

Browse files
committed
🐛 Fix textbox blink
1 parent 494ec8d commit 7be1f50

File tree

6 files changed

+10
-42
lines changed

6 files changed

+10
-42
lines changed

SRC/Aura_OS/Properties/VersionInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ namespace Aura_OS
22
{
33
public class VersionInfo
44
{
5-
public static string revision = "280220241601";
5+
public static string revision = "280220241717";
66
}
77
}

SRC/Aura_OS/System/Graphics/UI/GUI/Components/TextBox.cs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class TextBox : Component
1818
private bool _isSelected = false;
1919
private bool _cursorVisible = true;
2020
private DateTime _lastCursorBlink = DateTime.Now;
21-
private const int _cursorBlinkInterval = 400;
21+
private const int _cursorBlinkInterval = 1;
2222

2323
public TextBox(int x, int y, int width, int height, string text = "") : base(x, y, width, height)
2424
{
@@ -78,7 +78,7 @@ public override void Update()
7878
MarkDirty();
7979
}
8080

81-
if (_isSelected && (DateTime.Now - _lastCursorBlink).TotalMilliseconds > _cursorBlinkInterval)
81+
if ((DateTime.Now - _lastCursorBlink).Seconds > _cursorBlinkInterval)
8282
{
8383
_cursorVisible = !_cursorVisible;
8484
_lastCursorBlink = DateTime.Now;
@@ -92,19 +92,6 @@ public override void Draw()
9292
{
9393
base.Draw();
9494

95-
/*
96-
// Dessin du cadre de la TextBox
97-
Clear(Kernel.WhiteColor);
98-
DrawLine(Kernel.BlackColor, 0, 0, 0 + Width, 0);
99-
DrawLine(Kernel.Gray, 0, 0 + 1, 0 + Width, 0 + 1);
100-
DrawLine(Kernel.BlackColor, 0, 0, 0, 0 + Height);
101-
DrawLine(Kernel.Gray, 0 + 1, 0 + 1, 0 + 1, 0 + Height);
102-
DrawLine(Kernel.DarkGray, 0 + 1, 0 + Height - 1, 0 + Width, 0 + Height - 1);
103-
DrawLine(Kernel.WhiteColor, 0, 0 + Height, 0 + Width + 1, 0 + Height);
104-
DrawLine(Kernel.DarkGray, 0 + Width - 1, 0 + 1, 0 + Width - 1, 0 + Height);
105-
DrawLine(Kernel.WhiteColor, 0 + Width, 0, 0 + Width, 0 + Height);
106-
*/
107-
10895
string[] lines = Text.Split('\n');
10996
int offsetY = 0 + 4;
11097
int cursorX = 0 + 4;

SRC/Aura_OS/System/Graphics/UI/GUI/DirectBitmap.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,11 @@ public void DrawImageAlpha(Bitmap image, int x, int y, bool clearAlpha = false)
336336
return;
337337
}
338338

339+
if (y + image.Height > Bitmap.Height || y < 0)
340+
{
341+
return;
342+
}
343+
339344
DirectBitmap tmp = ExtractImage(x, y, (int)image.Width, (int)image.Height);
340345

341346
int w = tmp.Width;

SRC/Aura_OS/System/Graphics/UI/GUI/WindowManager.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -73,30 +73,6 @@ private void InsertionSortByZIndex(List<Component> components)
7373
}
7474
}
7575

76-
public void DrawComponents()
77-
{
78-
void DrawComponent(Component component)
79-
{
80-
if (component.IsRoot && component.Visible && (component.IsDirty() || component.ForceDirty))
81-
{
82-
component.Draw();
83-
component.MarkCleaned();
84-
Rectangle.AddClipRect(component.GetRectangle());
85-
}
86-
87-
foreach (var child in component.Children)
88-
{
89-
DrawComponent(child);
90-
}
91-
}
92-
93-
foreach (var component in Component.Components)
94-
{
95-
DrawComponent(component);
96-
}
97-
98-
}
99-
10076
public void DrawWindows()
10177
{
10278
if (Kernel.GuiDebug)

SRC/Aura_OS/System/Processing/ApplicationManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public void StartFileApplication(string fileName, string currentPath)
198198
{
199199
string path = currentPath + fileName;
200200

201-
var app = new EditorApp(path, 700, 600, 40, 40);
201+
var app = new EditorApp(path, 701, 600, 40, 40);
202202
app.Initialize();
203203
app.MarkFocused();
204204
app.Visible = true;

SRC/Aura_OS/System/Processing/Interpreter/Commands/Filesystem/Edit.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public override ReturnInfo Execute(List<string> arguments)
3434

3535
if (File.Exists(path))
3636
{
37-
var app = new EditorApp(path, 700, 600, 40, 40);
37+
var app = new EditorApp(path, 701, 600, 40, 40);
3838
app.Initialize();
3939
app.MarkFocused();
4040
app.Visible = true;

0 commit comments

Comments
 (0)