mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 10:10:05 +00:00 
			
		
		
		
	Respect alpha channel value for warning boxes using line-opacity property
This commit is contained in:
		
							parent
							
								
									902a35de4b
								
							
						
					
					
						commit
						66d261c680
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		|  | @ -413,11 +413,14 @@ static void AddAlertLayer(std::shared_ptr<QMapLibreGL::Map> map, | ||||||
|       map->removeLayer(fgLayerId); |       map->removeLayer(fgLayerId); | ||||||
|    } |    } | ||||||
| 
 | 
 | ||||||
|  |    const float opacity = outlineColor[3] / 255.0f; | ||||||
|  | 
 | ||||||
|    map->addLayer({{"id", bgLayerId}, {"type", "line"}, {"source", sourceId}}, |    map->addLayer({{"id", bgLayerId}, {"type", "line"}, {"source", sourceId}}, | ||||||
|                  beforeLayer); |                  beforeLayer); | ||||||
|    map->setLayoutProperty(bgLayerId, "line-join", "round"); |    map->setLayoutProperty(bgLayerId, "line-join", "round"); | ||||||
|    map->setLayoutProperty(bgLayerId, "line-cap", "round"); |    map->setLayoutProperty(bgLayerId, "line-cap", "round"); | ||||||
|    map->setPaintProperty(bgLayerId, "line-color", "rgba(0, 0, 0, 255)"); |    map->setPaintProperty(bgLayerId, "line-color", "rgba(0, 0, 0, 255)"); | ||||||
|  |    map->setPaintProperty(bgLayerId, "line-opacity", QString("%1").arg(opacity)); | ||||||
|    map->setPaintProperty(bgLayerId, "line-width", "5"); |    map->setPaintProperty(bgLayerId, "line-width", "5"); | ||||||
| 
 | 
 | ||||||
|    map->addLayer({{"id", fgLayerId}, {"type", "line"}, {"source", sourceId}}, |    map->addLayer({{"id", fgLayerId}, {"type", "line"}, {"source", sourceId}}, | ||||||
|  | @ -431,6 +434,7 @@ static void AddAlertLayer(std::shared_ptr<QMapLibreGL::Map> map, | ||||||
|                             .arg(outlineColor[1]) |                             .arg(outlineColor[1]) | ||||||
|                             .arg(outlineColor[2]) |                             .arg(outlineColor[2]) | ||||||
|                             .arg(outlineColor[3])); |                             .arg(outlineColor[3])); | ||||||
|  |    map->setPaintProperty(fgLayerId, "line-opacity", QString("%1").arg(opacity)); | ||||||
|    map->setPaintProperty(fgLayerId, "line-width", "3"); |    map->setPaintProperty(fgLayerId, "line-width", "3"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat