From c5bad6049fe4b1a487d2e3f66a72678bc0933fcd Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 1 Nov 2006 12:21:36 +0000 Subject: [PATCH] FRM's small wxSize::Scale enhancement. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42901 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/size.tex | 3 ++- include/wx/gdicmn.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/latex/wx/size.tex b/docs/latex/wx/size.tex index 7e163b47d2..3af3fa8d88 100644 --- a/docs/latex/wx/size.tex +++ b/docs/latex/wx/size.tex @@ -142,12 +142,13 @@ corresponding dimensions of the \arg{size}. \membersection{wxSize::Scale}\label{wxsizescale} -\func{void}{Scale}{\param{float}{ xscale}, \param{float}{ yscale}} +\func{wxSize\&}{Scale}{\param{float}{ xscale}, \param{float}{ yscale}} Scales the dimensions of this object by the given factors. If you want to scale both dimensions by the same factor you can also use the \helpref{operator *=}{wxsizeoperators} +Returns a reference to this object (so that you can concatenate other operations in the same line). \membersection{wxSize::Set}\label{wxsizeset} diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index a3ff41b1c4..7accd3a796 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -239,8 +239,8 @@ public: void DecBy(int d) { DecBy(d, d); } - void Scale(float xscale, float yscale) - { x = (int)(x*xscale); y = (int)(y*yscale); } + wxSize& Scale(float xscale, float yscale) + { x = (int)(x*xscale); y = (int)(y*yscale); return *this; } // accessors void Set(int xx, int yy) { x = xx; y = yy; } -- 2.45.2