Fixed Bug #3056670, RenderMode.EDIT was always even used when exporting.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@875 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2010-08-31 20:37:30 +00:00
commit cd8092859c
4 changed files with 13 additions and 11 deletions

View file

@ -307,7 +307,7 @@ namespace Greenshot.Drawing {
public virtual void DrawContent(Graphics graphics, Bitmap bmp, RenderMode renderMode) { 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(LOG.IsDebugEnabled) LOG.Debug("Drawing container "+this+" with bounds "+Bounds+" and " + Children.Count + " children and status: "+Status);
if(Children.Count>0) { if(Children.Count>0) {
if(!Status.Equals(EditStatus.IDLE)) { if(Status != EditStatus.IDLE) {
DrawSelectionBorder(graphics, Bounds); DrawSelectionBorder(graphics, Bounds);
} else { } else {
Rectangle effRect = Bounds; 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) { public virtual bool Contains(int x, int y) {

View file

@ -145,10 +145,10 @@ namespace Greenshot.Drawing {
/// Triggers all elements in the list ot be redrawn. /// Triggers all elements in the list ot be redrawn.
/// </summary> /// </summary>
/// <param name="g">the related Graphics object</param> /// <param name="g">the related Graphics object</param>
/// <param name="rm">the rendermode in which the element is to be drawn</param> /// <param name="renderMode">the rendermode in which the element is to be drawn</param>
public void Draw(Graphics g, Bitmap bitmap, RenderMode rm) { public void Draw(Graphics g, Bitmap bitmap, RenderMode renderMode) {
foreach(DrawableContainer dc in this) { foreach(DrawableContainer dc in this) {
dc.DrawContent(g, bitmap, rm); dc.DrawContent(g, bitmap, renderMode);
} }
} }

View file

@ -82,6 +82,7 @@ namespace Greenshot.Drawing {
g.DrawRectangle(pen, rect); g.DrawRectangle(pen, rect);
} }
} }
} }
} }

View file

@ -254,7 +254,7 @@ namespace Greenshot.Drawing {
UpdateFont(); UpdateFont();
Rectangle rect = GuiRectangle.GetGuiRectangle(this.Left, this.Top, this.Width, this.Height); 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); DrawSelectionBorder(g, rect);
} }
@ -276,7 +276,9 @@ namespace Greenshot.Drawing {
while (currentStep <= steps) { while (currentStep <= steps) {
int offset = currentStep; int offset = currentStep;
Rectangle shadowRect = GuiRectangle.GetGuiRectangle(Left + offset, Top + offset, Width, Height); 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))) { using (Brush fontBrush = new SolidBrush(Color.FromArgb(alpha, 100, 100, 100))) {
g.DrawString(text, font, fontBrush, shadowRect); g.DrawString(text, font, fontBrush, shadowRect);
currentStep++; currentStep++;
@ -287,13 +289,12 @@ namespace Greenshot.Drawing {
Color lineColor = GetFieldValueAsColor(FieldType.LINE_COLOR); Color lineColor = GetFieldValueAsColor(FieldType.LINE_COLOR);
Rectangle fontRect = rect; Rectangle fontRect = rect;
if(lineThickness>0) fontRect.Inflate(-textOffset,-textOffset); if(lineThickness > 0) {
fontRect.Inflate(-textOffset,-textOffset);
}
using (Brush fontBrush = new SolidBrush(lineColor)) { using (Brush fontBrush = new SolidBrush(lineColor)) {
g.DrawString(text, font, fontBrush, fontRect); g.DrawString(text, font, fontBrush, fontRect);
} }
} }
} }
} }