diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2014-07-15 06:45:40 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2014-07-15 06:45:40 +0100 |
commit | 4230f1f68f80a97bb0f55b5b0a2a5b50cc147469 (patch) | |
tree | 2e47b03ad0e68b2320dc480757229042bb92cffa /src/gui | |
parent | 4055647b8a0996c9a42173b710c9f211c8eb6406 (diff) | |
download | fpGUI-4230f1f68f80a97bb0f55b5b0a2a5b50cc147469.tar.xz |
Removed redundant code in TfpgScrollbar.
The Canvas.BeginDraw/EndDraw calls are not needed. The painting outside
the HandlePaint() event was long ago fixed, but these calls were simply
not removed.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/fpg_scrollbar.pas | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/gui/fpg_scrollbar.pas b/src/gui/fpg_scrollbar.pas index 6f99588a..1ec78952 100644 --- a/src/gui/fpg_scrollbar.pas +++ b/src/gui/fpg_scrollbar.pas @@ -134,7 +134,6 @@ end; procedure TfpgScrollBar.HandlePaint; begin - Canvas.BeginDraw; // Do not remove - Scrollbars do painting outside HandlePaint as well! if Orientation = orVertical then begin DrawButton(0, 0, Width, Width, 'sys.sb.up', (FScrollbarDownPart = sbpUpBack) and (FPosition <> FMin), (FPosition <> FMin) and (Parent.Enabled)); @@ -145,9 +144,7 @@ begin DrawButton(0, 0, Height, Height, 'sys.sb.left', (FScrollbarDownPart = sbpUpBack) and (FPosition <> FMin), (FPosition <> FMin) and (Parent.Enabled)); DrawButton(Width-Height, 0, Height, Height, 'sys.sb.right', (FScrollbarDownPart = sbpDownForward) and (FPosition <> FMax), (FPosition <> FMax) and (Parent.Enabled)); end; - DrawSlider(FRecalc); - Canvas.EndDraw; // Do not remove - Scrollbars do painting outside HandlePaint as well! FRecalc := False; end; @@ -162,7 +159,7 @@ begin if not HasHandle then Exit; //==> FRecalc := True; - Invalidate;// DrawSlider(True); + Invalidate; end; procedure TfpgScrollBar.LineUp; @@ -219,7 +216,7 @@ begin FPosition := AValue; if HasHandle then - Invalidate;// DrawSlider(False); + Invalidate; end; procedure TfpgScrollBar.Step(ASteps: Integer); @@ -576,7 +573,7 @@ begin FSliderPos := area; if ppos <> FSliderPos then - Invalidate; // DrawSlider(False); + Invalidate; if area <> 0 then newp := FMin + Trunc((FMax - FMin) * (FSliderPos / area)) @@ -609,7 +606,7 @@ begin if Visible then begin FRecalc := True; - Invalidate; // DrawSlider(True); + Invalidate; end; if Assigned(FOnScroll) then |