mirror of
				https://github.com/unanmed/HumanBreak.git
				synced 2025-10-31 12:12:58 +08:00 
			
		
		
		
	fix: 缩略图
This commit is contained in:
		
							parent
							
								
									b026287a71
								
							
						
					
					
						commit
						dd4d94d513
					
				| @ -15,6 +15,7 @@ export interface ThumbnailProps extends SpriteProps { | |||||||
|     // configs
 |     // configs
 | ||||||
|     damage?: boolean; |     damage?: boolean; | ||||||
|     all?: boolean; |     all?: boolean; | ||||||
|  |     size?: number; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| export const Thumbnail = defineComponent<ThumbnailProps>(props => { | export const Thumbnail = defineComponent<ThumbnailProps>(props => { | ||||||
| @ -25,13 +26,14 @@ export const Thumbnail = defineComponent<ThumbnailProps>(props => { | |||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     const drawThumbnail = (canvas: MotaOffscreenCanvas2D) => { |     const drawThumbnail = (canvas: MotaOffscreenCanvas2D) => { | ||||||
|  |         const ctx = canvas.ctx; | ||||||
|         const hero = props.hero; |         const hero = props.hero; | ||||||
|         const options: Partial<DrawThumbnailConfig> = { |         const options: Partial<DrawThumbnailConfig> = { | ||||||
|             damage: props.damage, |             damage: props.damage, | ||||||
|             ctx: canvas.ctx, |             ctx: ctx, | ||||||
|             x: 0, |             x: 0, | ||||||
|             y: 0, |             y: 0, | ||||||
|             size: 1, |             size: props.size ?? 1, | ||||||
|             all: props.all, |             all: props.all, | ||||||
|             noHD: false, |             noHD: false, | ||||||
|             v2: true, |             v2: true, | ||||||
| @ -44,7 +46,11 @@ export const Thumbnail = defineComponent<ThumbnailProps>(props => { | |||||||
|             options.centerX = hero.loc.x; |             options.centerX = hero.loc.x; | ||||||
|             options.centerY = hero.loc.y; |             options.centerY = hero.loc.y; | ||||||
|         } |         } | ||||||
|  |         ctx.save(); | ||||||
|  |         ctx.fillStyle = props.padStyle; | ||||||
|  |         ctx.fillRect(0, 0, canvas.width, canvas.height); | ||||||
|         core.drawThumbnail(props.floorId, props.map, options); |         core.drawThumbnail(props.floorId, props.map, options); | ||||||
|  |         ctx.restore(); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     watch(props, update); |     watch(props, update); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user