File indexing completed on 2024-07-14 07:17:25

0001 /*
0002     SPDX-FileCopyrightText: 2021 Hy Murveit <hy@murveit.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "terraincomponent.h"
0008 
0009 #include "Options.h"
0010 #include "skypainter.h"
0011 #include "skymap.h"
0012 
0013 TerrainComponent::TerrainComponent(SkyComposite *parent) : SkyComponent(parent)
0014 {
0015 }
0016 
0017 bool TerrainComponent::selected()
0018 {
0019     return Options::showTerrain();
0020 }
0021 
0022 void TerrainComponent::draw(SkyPainter *skyp)
0023 {
0024 #if !defined(KSTARS_LITE)
0025     if (((SkyMap::IsSlewing() == false) || Options::terrainPanning()) && selected())
0026         skyp->drawTerrain();
0027 #else
0028     Q_UNUSED(skyp);
0029 #endif
0030 }