From 3840feb791885c608d579e2693ecef84d1df94ff Mon Sep 17 00:00:00 2001 From: Tobias Lohner Date: Fri, 17 Feb 2012 19:44:53 +0100 Subject: [PATCH] GlueMapWindowOverlays: adjust ThermalBand and FinalGlideBar sizing The ThermalBand sizing was way too large previously and interfered even with the old FinalGlideBar. The new FinalGlideBar got new clipping indicators, so reduce it's sizing from 60 units to 55 units height. --- src/MapWindow/GlueMapWindowOverlays.cpp | 4 ++-- src/Renderer/FinalGlideBarRenderer.cpp | 38 ++++++++++++++++----------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/MapWindow/GlueMapWindowOverlays.cpp b/src/MapWindow/GlueMapWindowOverlays.cpp index 82d9be1e2..c4e8e3d7f 100644 --- a/src/MapWindow/GlueMapWindowOverlays.cpp +++ b/src/MapWindow/GlueMapWindowOverlays.cpp @@ -340,8 +340,8 @@ GlueMapWindow::DrawThermalBand(Canvas &canvas, const PixelRect &rc) const PixelRect tb_rect; tb_rect.left = rc.left; tb_rect.right = rc.left+Layout::Scale(20); - tb_rect.top = Layout::Scale(4); - tb_rect.bottom = tb_rect.top+(rc.bottom-rc.top)/2-Layout::Scale(30); + tb_rect.top = Layout::Scale(2); + tb_rect.bottom = (rc.bottom-rc.top)/2-Layout::Scale(73); const ThermalBandRenderer &renderer = thermal_band_renderer; if (task != NULL) { diff --git a/src/Renderer/FinalGlideBarRenderer.cpp b/src/Renderer/FinalGlideBarRenderer.cpp index 0772d8042..22dd77e9c 100644 --- a/src/Renderer/FinalGlideBarRenderer.cpp +++ b/src/Renderer/FinalGlideBarRenderer.cpp @@ -67,22 +67,22 @@ FinalGlideBarRenderer::Draw(Canvas &canvas, const PixelRect &rc, canvas.Select(Fonts::map_bold); const PixelSize text_size = canvas.CalcTextSize(Value); - PixelScalar clipping_arrow_offset = Layout::Scale(6); - PixelScalar clipping_arrow0_offset = Layout::Scale(6); + PixelScalar clipping_arrow_offset = Layout::Scale(4); + PixelScalar clipping_arrow0_offset = Layout::Scale(4); - // 480 meters is it's size. Will be divided by 8 to fit screen resolution. + // 468 meters is it's size. Will be divided by 9 to fit screen resolution. int altitude_difference = ((int)calculated.task_stats.total.solution_remaining.altitude_difference); int altitude_difference0 = ((int)calculated.task_stats.total.solution_mc0.altitude_difference); // TODO feature: should be an angle if in final glide mode - // cut altitude_difference at +- 480 meters (60 units) - if (altitude_difference > 480) - altitude_difference = 480; - if (altitude_difference < -480) - altitude_difference = -480; + // cut altitude_difference at +- 468 meters (55 units) + if (altitude_difference > 468) + altitude_difference = 468; + if (altitude_difference < -468) + altitude_difference = -468; - // 60 units is size, 480 meters div by 8 means 60. - int Offset = altitude_difference / 8; + // 55 units is size, 468 meters div by 9 means 55. + int Offset = altitude_difference / 9; Offset = Layout::Scale(Offset); if (altitude_difference <= 0) { @@ -98,14 +98,14 @@ FinalGlideBarRenderer::Draw(Canvas &canvas, const PixelRect &rc, dy_glidebar = -1; } - // cut altitude_difference0 at +- 480 meters (60 units) - if (altitude_difference0 > 480) - altitude_difference0 = 480; - if (altitude_difference0 < -480) - altitude_difference0 = -480; + // cut altitude_difference0 at +- 468 meters (55 units) + if (altitude_difference0 > 468) + altitude_difference0 = 468; + if (altitude_difference0 < -468) + altitude_difference0 = -468; - // -50 to +60 units is size, therefore div by 8. - int Offset0 = altitude_difference0 / 8; + // 55 units is size, therefore div by 9. + int Offset0 = altitude_difference0 / 9; Offset0 = Layout::Scale(Offset0); if (altitude_difference0 <= 0) { @@ -173,7 +173,7 @@ FinalGlideBarRenderer::Draw(Canvas &canvas, const PixelRect &rc, canvas.polygon(GlideBar, 6); // draw clipping arrow - if ((altitude_difference <= -480 ) || (altitude_difference >= 480)) + if ((altitude_difference <= -468 ) || (altitude_difference >= 468)) canvas.polygon(clipping_arrow, 6); // draw glide bar at mc 0 @@ -194,7 +194,7 @@ FinalGlideBarRenderer::Draw(Canvas &canvas, const PixelRect &rc, && final_glide_bar_mc0_enabled) { canvas.polygon(GlideBar0, 4); - if ((altitude_difference0 <= -480 ) || (altitude_difference0 >= 480)) + if ((altitude_difference0 <= -468 ) || (altitude_difference0 >= 468)) canvas.polygon(clipping_arrow0, 4); } -- 2.11.4.GIT