forked from MapComplete/MapComplete
		
	Refactoring: remove _img from Svg.ts
This commit is contained in:
		
							parent
							
								
									5a2e54b00a
								
							
						
					
					
						commit
						15063f9be0
					
				
					 3 changed files with 4 additions and 6 deletions
				
			
		|  | @ -73,7 +73,7 @@ export class WikimediaImageProvider extends ImageProvider { | |||
|         } | ||||
| 
 | ||||
|         return new Link( | ||||
|             Svg.wikimedia_commons_white_img, | ||||
|             Svg.wikimedia_commons_white_svg(), | ||||
|             `https://commons.wikimedia.org/wiki/${backlink}`, | ||||
|             true | ||||
|         ) | ||||
|  |  | |||
|  | @ -87,7 +87,7 @@ export default class PointRenderingConfig extends WithContextLoader { | |||
|         const iconPath = this.icon?.GetRenderValue({ id: "node/-1" })?.txt | ||||
|         if (iconPath !== undefined && iconPath.startsWith(Utils.assets_path)) { | ||||
|             const iconKey = iconPath.substr(Utils.assets_path.length) | ||||
|             if (Constants.defaultPinIcons.indexOf(iconKey) < 0) { | ||||
|             if (Svg.All[iconKey] === undefined) { | ||||
|                 throw context + ": builtin SVG asset not found: " + iconPath | ||||
|             } | ||||
|         } | ||||
|  |  | |||
|  | @ -39,10 +39,8 @@ function genImages(dryrun = false) { | |||
|         let rawName = name | ||||
| 
 | ||||
|         module += `    public static ${name} = "${svg}"\n` | ||||
|         module += `    public static ${name}_img = Img.AsImageElement(Svg.${rawName})\n` | ||||
|         module += `    public static ${name}_svg() { return new Img(Svg.${rawName}, true);}\n` | ||||
|        // module += `    /**@deprecated*/ public static ${name}_ui() { return new FixedUiElement(Svg.${rawName}_img);}\n\n`
 | ||||
|         if (Constants.defaultPinIcons.indexOf(name) >= 0 && !dryrun) { | ||||
|         if (!dryrun) { | ||||
|             allNames.push(`"${path}": Svg.${name}`) | ||||
|         } | ||||
|     } | ||||
|  | @ -52,4 +50,4 @@ function genImages(dryrun = false) { | |||
|     console.log("Done") | ||||
| } | ||||
| 
 | ||||
| genImages(false) | ||||
| genImages() | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue