import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
import Box from '../box/box.jsx';
import Label from '../forms/label.jsx';
import Input from '../forms/input.jsx';
import BufferedInputHOC from '../forms/buffered-input-hoc.jsx';
import DirectionPicker from '../../containers/direction-picker.jsx';
import {injectIntl, intlShape, defineMessages, FormattedMessage} from 'react-intl';
import {STAGE_DISPLAY_SIZES} from '../../lib/layout-constants.js';
import {isWideLocale} from '../../lib/locale-utils.js';
import styles from './sprite-info.css';
import xIcon from './icon--x.svg';
import yIcon from './icon--y.svg';
import showIcon from './icon--show.svg';
import hideIcon from './icon--hide.svg';
const BufferedInput = BufferedInputHOC(Input);
const messages = defineMessages({
spritePlaceholder: {
id: 'gui.SpriteInfo.spritePlaceholder',
defaultMessage: 'Name',
description: 'Placeholder text for sprite name'
}
});
class SpriteInfo extends React.Component {
shouldComponentUpdate (nextProps) {
return (
this.props.rotationStyle !== nextProps.rotationStyle ||
this.props.disabled !== nextProps.disabled ||
this.props.name !== nextProps.name ||
this.props.stageSize !== nextProps.stageSize ||
this.props.visible !== nextProps.visible ||
// Only update these if rounded value has changed
Math.round(this.props.direction) !== Math.round(nextProps.direction) ||
Math.round(this.props.size) !== Math.round(nextProps.size) ||
Math.round(this.props.x) !== Math.round(nextProps.x) ||
Math.round(this.props.y) !== Math.round(nextProps.y)
);
}
render () {
const {
stageSize
} = this.props;
const sprite = (