diff --git a/GreenshotEditor/Drawing/DrawableContainer.cs b/GreenshotEditor/Drawing/DrawableContainer.cs index 692417fd7..bbed49d1b 100644 --- a/GreenshotEditor/Drawing/DrawableContainer.cs +++ b/GreenshotEditor/Drawing/DrawableContainer.cs @@ -307,7 +307,7 @@ namespace Greenshot.Drawing { public virtual void DrawContent(Graphics graphics, Bitmap bmp, RenderMode renderMode) { //if(LOG.IsDebugEnabled) LOG.Debug("Drawing container "+this+" with bounds "+Bounds+" and " + Children.Count + " children and status: "+Status); if(Children.Count>0) { - if(!Status.Equals(EditStatus.IDLE)) { + if(Status != EditStatus.IDLE) { DrawSelectionBorder(graphics, Bounds); } else { Rectangle effRect = Bounds; @@ -321,7 +321,7 @@ namespace Greenshot.Drawing { } } - Draw(graphics, RenderMode.EDIT); + Draw(graphics, renderMode); } public virtual bool Contains(int x, int y) { diff --git a/GreenshotEditor/Drawing/DrawableContainerList.cs b/GreenshotEditor/Drawing/DrawableContainerList.cs index e883f3e31..98591acb4 100644 --- a/GreenshotEditor/Drawing/DrawableContainerList.cs +++ b/GreenshotEditor/Drawing/DrawableContainerList.cs @@ -145,10 +145,10 @@ namespace Greenshot.Drawing { /// Triggers all elements in the list ot be redrawn. /// /// the related Graphics object - /// the rendermode in which the element is to be drawn - public void Draw(Graphics g, Bitmap bitmap, RenderMode rm) { + /// the rendermode in which the element is to be drawn + public void Draw(Graphics g, Bitmap bitmap, RenderMode renderMode) { foreach(DrawableContainer dc in this) { - dc.DrawContent(g, bitmap, rm); + dc.DrawContent(g, bitmap, renderMode); } } diff --git a/GreenshotEditor/Drawing/RectangleContainer.cs b/GreenshotEditor/Drawing/RectangleContainer.cs index 1eefa9c26..250048878 100644 --- a/GreenshotEditor/Drawing/RectangleContainer.cs +++ b/GreenshotEditor/Drawing/RectangleContainer.cs @@ -82,6 +82,7 @@ namespace Greenshot.Drawing { g.DrawRectangle(pen, rect); } } + } } diff --git a/GreenshotEditor/Drawing/TextContainer.cs b/GreenshotEditor/Drawing/TextContainer.cs index 3a35b2285..d5e06a008 100644 --- a/GreenshotEditor/Drawing/TextContainer.cs +++ b/GreenshotEditor/Drawing/TextContainer.cs @@ -254,7 +254,7 @@ namespace Greenshot.Drawing { UpdateFont(); Rectangle rect = GuiRectangle.GetGuiRectangle(this.Left, this.Top, this.Width, this.Height); - if (Selected && !rm.Equals(RenderMode.EXPORT)) { + if (Selected && rm == RenderMode.EDIT) { DrawSelectionBorder(g, rect); } @@ -276,7 +276,9 @@ namespace Greenshot.Drawing { while (currentStep <= steps) { int offset = currentStep; Rectangle shadowRect = GuiRectangle.GetGuiRectangle(Left + offset, Top + offset, Width, Height); - if(lineThickness>0) shadowRect.Inflate(-textOffset, -textOffset); + if(lineThickness > 0) { + shadowRect.Inflate(-textOffset, -textOffset); + } using (Brush fontBrush = new SolidBrush(Color.FromArgb(alpha, 100, 100, 100))) { g.DrawString(text, font, fontBrush, shadowRect); currentStep++; @@ -287,13 +289,12 @@ namespace Greenshot.Drawing { Color lineColor = GetFieldValueAsColor(FieldType.LINE_COLOR); Rectangle fontRect = rect; - if(lineThickness>0) fontRect.Inflate(-textOffset,-textOffset); + if(lineThickness > 0) { + fontRect.Inflate(-textOffset,-textOffset); + } using (Brush fontBrush = new SolidBrush(lineColor)) { g.DrawString(text, font, fontBrush, fontRect); } - } - - } }