Correction of code format with AStyle

This commit is contained in:
Pandagrapher
2018-06-18 19:21:57 +02:00
parent 273171a1b0
commit 74dd3a6a10
5 changed files with 952 additions and 952 deletions

View File

@@ -41,21 +41,21 @@ void ObjectMOBuffer::setObjectMode (ObjectMode newType)
if (w && h) {
switch (newType) {
case (OM_255):
if (objectMode == OM_65535) {
objectMap->unreference();
objectMap = Cairo::ImageSurface::create (Cairo::FORMAT_A8, w, h);
}
case (OM_255):
if (objectMode == OM_65535) {
objectMap->unreference();
objectMap = Cairo::ImageSurface::create (Cairo::FORMAT_A8, w, h);
}
break;
break;
case (OM_65535):
if (objectMode == OM_255) {
objectMap->unreference();
objectMap = Cairo::ImageSurface::create (Cairo::FORMAT_RGB16_565, w, h);
}
case (OM_65535):
if (objectMode == OM_255) {
objectMap->unreference();
objectMap = Cairo::ImageSurface::create (Cairo::FORMAT_RGB16_565, w, h);
}
break;
break;
}
}
@@ -382,13 +382,13 @@ void Arcellipse::drawInnerGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOB
cr->save();
// To have an ellipse with radius of (rad1, rad2), a circle of radius rad1 shall be twisted with a scale
// of rad2 / rad1 for y axis
// Center of coordinates (x, y) in previous coordinates system becomes (X, Y) = (x, rad2 / rad1 * y) in new one
// To go back to previous location, center shall be translated to t = -Y * (1 - rad1 / rad2) in y axis
// (Y = rad2 / rad1 * y and y = t + Y)
double scale_ = radius2_ / radius_;
cr->scale (1., scale_);
cr->translate (0., - center_.y * (1 - 1 / scale_));
// of rad2 / rad1 for y axis
// Center of coordinates (x, y) in previous coordinates system becomes (X, Y) = (x, rad2 / rad1 * y) in new one
// To go back to previous location, center shall be translated to t = -Y * (1 - rad1 / rad2) in y axis
// (Y = rad2 / rad1 * y and y = t + Y)
double scale_ = radius2_ / radius_;
cr->scale (1., scale_);
cr->translate (0., - center_.y * (1 - 1 / scale_));
cr->arc (center_.x + 0.5, center_.y + 0.5, radius_, begang_, endang_);
@@ -407,13 +407,13 @@ void Arcellipse::drawInnerGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOB
cr->save();
// To have an ellipse with radius of (rad1, rad2), a circle of radius rad1 shall be twisted with a scale
// of rad2 / rad1 for y axis
// Center of coordinates (x, y) in previous coordinates system becomes (X, Y) = (x, rad2 / rad1 * y) in new one
// To go back to previous location, center shall be translated to t = -Y * (1 - rad1 / rad2) in y axis
// (Y = rad2 / rad1 * y and y = t + Y)
double scale_ = radius2_ / radius_;
cr->scale (1., scale_);
cr->translate (0., - center_.y * (1 - 1 / scale_));
// of rad2 / rad1 for y axis
// Center of coordinates (x, y) in previous coordinates system becomes (X, Y) = (x, rad2 / rad1 * y) in new one
// To go back to previous location, center shall be translated to t = -Y * (1 - rad1 / rad2) in y axis
// (Y = rad2 / rad1 * y and y = t + Y)
double scale_ = radius2_ / radius_;
cr->scale (1., scale_);
cr->translate (0., - center_.y * (1 - 1 / scale_));
cr->arc (center_.x + 0.5, center_.y + 0.5, radius_, begang_, endang_);
@@ -463,13 +463,13 @@ void Arcellipse::drawToMOChannel (Cairo::RefPtr<Cairo::Context> &cr, unsigned sh
cr->save();
// To have an ellipse with radius of (rad1, rad2), a circle of radius rad1 shall be twisted with a scale
// of rad2 / rad1 for y axis
// Center of coordinates (x, y) in previous coordinates system becomes (X, Y) = (x, rad2 / rad1 * y) in new one
// To go back to previous location, center shall be translated to t = -Y * (1 - rad1 / rad2) in y axis
// (Y = rad2 / rad1 * y and y = t + Y)
double scale_ = radius2_ / radius_;
cr->scale (1., scale_);
cr->translate (0., - center_.y * (1 - 1 / scale_));
// of rad2 / rad1 for y axis
// Center of coordinates (x, y) in previous coordinates system becomes (X, Y) = (x, rad2 / rad1 * y) in new one
// To go back to previous location, center shall be translated to t = -Y * (1 - rad1 / rad2) in y axis
// (Y = rad2 / rad1 * y and y = t + Y)
double scale_ = radius2_ / radius_;
cr->scale (1., scale_);
cr->translate (0., - center_.y * (1 - 1 / scale_));
cr->arc (center_.x + 0.5, center_.y + 0.5, radius_, begang_, endang_);
@@ -1095,50 +1095,50 @@ void OPIcon::drivenPointToRectangle (const rtengine::Coord &pos,
rtengine::Coord &topLeft, rtengine::Coord &bottomRight, int W, int H)
{
switch (drivenPoint) {
case (DP_CENTERCENTER):
topLeft.x = pos.x - W / 2;
topLeft.y = pos.y - H / 2;
break;
case (DP_CENTERCENTER):
topLeft.x = pos.x - W / 2;
topLeft.y = pos.y - H / 2;
break;
case (DP_TOPLEFT):
topLeft.x = pos.x;
topLeft.y = pos.y;
break;
case (DP_TOPLEFT):
topLeft.x = pos.x;
topLeft.y = pos.y;
break;
case (DP_TOPCENTER):
topLeft.x = pos.x - W / 2;
topLeft.y = pos.y;
break;
case (DP_TOPCENTER):
topLeft.x = pos.x - W / 2;
topLeft.y = pos.y;
break;
case (DP_TOPRIGHT):
topLeft.x = pos.x - W;
topLeft.y = pos.y;
break;
case (DP_TOPRIGHT):
topLeft.x = pos.x - W;
topLeft.y = pos.y;
break;
case (DP_CENTERRIGHT):
topLeft.x = pos.x - W;
topLeft.y = pos.y - H / 2;
break;
case (DP_CENTERRIGHT):
topLeft.x = pos.x - W;
topLeft.y = pos.y - H / 2;
break;
case (DP_BOTTOMRIGHT):
topLeft.x = pos.x - W;
topLeft.y = pos.y - H;
break;
case (DP_BOTTOMRIGHT):
topLeft.x = pos.x - W;
topLeft.y = pos.y - H;
break;
case (DP_BOTTOMCENTER):
topLeft.x = pos.x - W / 2;
topLeft.y = pos.y - H;
break;
case (DP_BOTTOMCENTER):
topLeft.x = pos.x - W / 2;
topLeft.y = pos.y - H;
break;
case (DP_BOTTOMLEFT):
topLeft.x = pos.x;
topLeft.y = pos.y - H;
break;
case (DP_BOTTOMLEFT):
topLeft.x = pos.x;
topLeft.y = pos.y - H;
break;
case (DP_CENTERLEFT):
topLeft.x = pos.x;
topLeft.y = pos.y - H / 2;
break;
case (DP_CENTERLEFT):
topLeft.x = pos.x;
topLeft.y = pos.y - H / 2;
break;
}
bottomRight.x = topLeft.x + W - 1;