Skip to content

Commit

Permalink
Fixed resizing Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Mourthag committed Oct 11, 2015
1 parent fe6ac97 commit d9242eb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions UI/Components/Note.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class Note : IComponent

public string ComponentName => "Note";

public float HorizontalWidth => 200f;
public float HorizontalWidth { get; set; }

public float MinimumHeight { get; set; }

public float VerticalHeight => 50f;
public float VerticalHeight { get; set; }

public float MinimumWidth { get; set; }

Expand All @@ -46,6 +46,9 @@ public Note(NoteType type, string note, NotesComponentSettings settings)
Type = type;
Text = note;

VerticalHeight = 10f;
HorizontalWidth = 100f;

switch (type)
{
case NoteType.LevelUp:
Expand Down Expand Up @@ -85,13 +88,15 @@ public Note(NoteType type, string note, NotesComponentSettings settings)

public void DrawHorizontal(Graphics g, LiveSplitState state, float height, Region clipRegion)
{
HorizontalWidth = g.MeasureString(Text, state.LayoutSettings.TextFont).Width;
DrawBackgorund(g, HorizontalWidth, height);
var textBrush = new SolidBrush(txtColor);
g.DrawString(Text, state.LayoutSettings.TextFont, textBrush, new PointF(0, 0));
}

public void DrawVertical(Graphics g, LiveSplitState state, float width, Region clipRegion)
{
VerticalHeight = state.LayoutSettings.TextFont.GetHeight(g);
DrawBackgorund(g, width, VerticalHeight);
var textBrush = new SolidBrush(txtColor);
g.DrawString(Text, state.LayoutSettings.TextFont, textBrush, new PointF(0, 0));
Expand Down

0 comments on commit d9242eb

Please sign in to comment.