Merge pull request #6147 from robintown/easier-image-panning

This commit is contained in:
Michael Telatynski 2021-06-07 12:47:43 +01:00 committed by GitHub
commit b60feab7d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View file

@ -22,6 +22,7 @@ limitations under the License.
} }
.mx_ImageView_image_wrapper { .mx_ImageView_image_wrapper {
pointer-events: initial;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -30,7 +31,6 @@ limitations under the License.
} }
.mx_ImageView_image { .mx_ImageView_image {
pointer-events: all;
flex-shrink: 0; flex-shrink: 0;
} }
@ -43,7 +43,7 @@ limitations under the License.
} }
.mx_ImageView_info_wrapper { .mx_ImageView_info_wrapper {
pointer-events: all; pointer-events: initial;
padding-left: 32px; padding-left: 32px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@ -63,7 +63,7 @@ limitations under the License.
.mx_ImageView_toolbar { .mx_ImageView_toolbar {
padding-right: 16px; padding-right: 16px;
pointer-events: all; pointer-events: initial;
display: flex; display: flex;
align-items: center; align-items: center;
} }

View file

@ -471,7 +471,12 @@ export default class ImageView extends React.Component<IProps, IState> {
</div> </div>
<div <div
className="mx_ImageView_image_wrapper" className="mx_ImageView_image_wrapper"
ref={this.imageWrapper}> ref={this.imageWrapper}
onMouseDown={this.props.onFinished}
onMouseMove={this.onMoving}
onMouseUp={this.onEndMoving}
onMouseLeave={this.onEndMoving}
>
<img <img
src={this.props.src} src={this.props.src}
title={this.props.name} title={this.props.name}
@ -480,9 +485,6 @@ export default class ImageView extends React.Component<IProps, IState> {
className="mx_ImageView_image" className="mx_ImageView_image"
draggable={true} draggable={true}
onMouseDown={this.onStartMoving} onMouseDown={this.onStartMoving}
onMouseMove={this.onMoving}
onMouseUp={this.onEndMoving}
onMouseLeave={this.onEndMoving}
/> />
</div> </div>
</FocusLock> </FocusLock>