[haiku-commits] Re: BRANCH looncraz-github.CAP-volatile [bf2a2098b3da] in src/servers/app: . drawing

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 18 Mar 2015 20:47:34 +0100

Hi looncraz,

I just wanted to pick a few style issues, since I guess the plan is to put this into the main repository one day:

On 03/18/2015 07:46 PM, looncraz-github.CAP-volatile wrote:
@@ -754,6 +844,289 @@ View::ConvertFromScreen(BRegion* region) const
  }


+// #pragma mark ConvertToWindow
+
+/*!    ConvertToWindow(...) functions convert rects, points, regions, or

Two blank lines.

+//! converts point from view to drawing coordinate system

Please start sentences with upper case.

+void
+View::ConvertForDrawing(BPoint* point) const
+{
+       fDrawState->Transform(point);
+
+       ConvertToWindow(point);
+
+       if (fWindow)

if (fWindow != NULL)

+//! converts a gradient from local to drawing coordinate system
+void
+View::ConvertForDrawing(BGradient* gradient) const
+{
+       switch(gradient->GetType()) {

Space between 'switch' and '('.

+               case BGradient::TYPE_LINEAR: {

'{' goes to the next line for case/labels.

+                       BGradientLinear* linear = (BGradientLinear*) gradient;

No space between cast and variable.

+Window::SetWindowBufferEnabled(bool enable)
[...]
+       }else{

Spaces before and after 'else'.

+void
+Window::ConvertViewToDrawing(BPoint* point) const
+{
+       BRect wf = Frame();

'wf' is not a good name. If you mean the window frame, use windowFrame.

+       if (IsWindowBufferEnabled() == false) {

BTW, since the type is bool already, it's perfectly fine to use !Is...().

Bye,
   Axel.


Other related posts: