Skip to content

Commit

Permalink
fix(Image): override scale prop (#1078)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett authored Oct 5, 2022
1 parent 161c486 commit d5842b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Color, extend, useThree } from '@react-three/fiber'
import { shaderMaterial } from './shaderMaterial'
import { useTexture } from './useTexture'

export type ImageProps = JSX.IntrinsicElements['mesh'] & {
export type ImageProps = Omit<JSX.IntrinsicElements['mesh'], 'scale'> & {
segments?: number
scale?: number | [number, number]
color?: Color
Expand Down Expand Up @@ -97,7 +97,7 @@ const ImageBase = React.forwardRef(
const planeBounds = Array.isArray(scale) ? [scale[0], scale[1]] : [scale, scale]
const imageBounds = [texture!.image.width, texture!.image.height]
return (
<mesh ref={ref} scale={scale} {...props}>
<mesh ref={ref} scale={Array.isArray(scale) ? [...scale, 1] : scale} {...props}>
<planeGeometry args={[1, 1, segments, segments]} />
<imageMaterial
color={color}
Expand Down

1 comment on commit d5842b0

@vercel
Copy link

@vercel vercel bot commented on d5842b0 Oct 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.