From 0398e831dbc8292bcc2c91bf188dd3659e09ee62 Mon Sep 17 00:00:00 2001 From: RKrom Date: Fri, 3 Feb 2012 12:00:06 +0000 Subject: [PATCH] Fixed TextContainer resize, by making the ApplyBounds virtual and overriding it in the TextContainer git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1628 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- Greenshot/Drawing/DrawableContainer.cs | 10 +++++----- Greenshot/Drawing/TextContainer.cs | 5 +++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Greenshot/Drawing/DrawableContainer.cs b/Greenshot/Drawing/DrawableContainer.cs index 5e247edb3..8bb41cce8 100644 --- a/Greenshot/Drawing/DrawableContainer.cs +++ b/Greenshot/Drawing/DrawableContainer.cs @@ -164,16 +164,16 @@ namespace Greenshot.Drawing { set { Left = round(value.Left); Top = round(value.Top); - Width = round(value.Width); - Height = round(value.Height); + Width = round(value.Width); + Height = round(value.Height); } } - public void ApplyBounds(RectangleF newBounds) { + public virtual void ApplyBounds(RectangleF newBounds) { Left = round(newBounds.Left); Top = round(newBounds.Top); - Width = round(newBounds.Width); - Height = round(newBounds.Height); + Width = round(newBounds.Width); + Height = round(newBounds.Height); } public DrawableContainer(Surface parent) { diff --git a/Greenshot/Drawing/TextContainer.cs b/Greenshot/Drawing/TextContainer.cs index 8f9ebee21..c788c4e5f 100644 --- a/Greenshot/Drawing/TextContainer.cs +++ b/Greenshot/Drawing/TextContainer.cs @@ -238,6 +238,11 @@ namespace Greenshot.Drawing { textBox.Height = this.Height; } + public override void ApplyBounds(RectangleF newBounds) { + base.ApplyBounds(newBounds); + UpdateTextBoxPosition(); + } + private void UpdateTextBoxFormat() { UpdateFont(); Color lineColor = GetFieldValueAsColor(FieldType.LINE_COLOR);