mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 01:10:04 +00:00 
			
		
		
		
	Fix display scaling for custom map widgets
This commit is contained in:
		
							parent
							
								
									fceb5c33f7
								
							
						
					
					
						commit
						53c2f29785
					
				
					 5 changed files with 26 additions and 5 deletions
				
			
		|  | @ -13,6 +13,7 @@ public: | |||
|    explicit Impl(std::shared_ptr<view::RadarProductView> radarProductView) : | ||||
|        map_ {}, | ||||
|        settings_ {}, | ||||
|        pixelRatio_ {1.0f}, | ||||
|        radarProductView_ {radarProductView}, | ||||
|        radarProductGroup_ {common::RadarProductGroup::Unknown}, | ||||
|        radarProduct_ {"???"}, | ||||
|  | @ -24,6 +25,7 @@ public: | |||
| 
 | ||||
|    std::weak_ptr<QMapLibreGL::Map>         map_; | ||||
|    MapSettings                             settings_; | ||||
|    float                                   pixelRatio_; | ||||
|    std::shared_ptr<view::RadarProductView> radarProductView_; | ||||
|    common::RadarProductGroup               radarProductGroup_; | ||||
|    std::string                             radarProduct_; | ||||
|  | @ -50,6 +52,11 @@ MapSettings& MapContext::settings() | |||
|    return p->settings_; | ||||
| } | ||||
| 
 | ||||
| float MapContext::pixel_ratio() const | ||||
| { | ||||
|    return p->pixelRatio_; | ||||
| } | ||||
| 
 | ||||
| std::shared_ptr<view::RadarProductView> MapContext::radar_product_view() const | ||||
| { | ||||
|    return p->radarProductView_; | ||||
|  | @ -75,6 +82,11 @@ void MapContext::set_map(std::shared_ptr<QMapLibreGL::Map> map) | |||
|    p->map_ = map; | ||||
| } | ||||
| 
 | ||||
| void MapContext::set_pixel_ratio(float pixelRatio) | ||||
| { | ||||
|    p->pixelRatio_ = pixelRatio; | ||||
| } | ||||
| 
 | ||||
| void MapContext::set_radar_product_view( | ||||
|    std::shared_ptr<view::RadarProductView> radarProductView) | ||||
| { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat