Refactor #1266 (code quality and simplicity)

This commit is contained in:
Wojtek Figat
2023-09-11 20:02:53 +02:00
parent 2ddb44afa8
commit 16fed8927c
14 changed files with 241 additions and 584 deletions

View File

@@ -441,11 +441,9 @@ namespace FlaxEditor.Content
{
get
{
// Skip when hidden
if (!Visible)
{
return Rectangle.Empty;
}
var view = Parent as ContentView;
var size = Size;
switch (view?.ViewType ?? ContentViewType.Tiles)
@@ -453,7 +451,7 @@ namespace FlaxEditor.Content
case ContentViewType.Tiles:
{
var textHeight = DefaultTextHeight * size.X / DefaultWidth;
return new Rectangle(0, size.Y - textHeight, size.X - 2, textHeight);
return new Rectangle(0, size.Y - textHeight, size.X, textHeight);
}
case ContentViewType.List:
{
@@ -671,8 +669,6 @@ namespace FlaxEditor.Content
/// <inheritdoc />
public override void Draw()
{
// Cache data
var size = Size;
var style = Style.Current;
var view = Parent as ContentView;