You've already forked matrix-react-sdk
							
							
				mirror of
				https://github.com/matrix-org/matrix-react-sdk.git
				synced 2025-11-04 11:51:45 +03:00 
			
		
		
		
	Use height and width properties for scaling again
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
		@@ -33,17 +33,18 @@ limitations under the License.
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.mx_ImageView_imageBox {
 | 
					.mx_ImageView_imageBox {
 | 
				
			||||||
    overflow: auto;
 | 
					    overflow: scroll;
 | 
				
			||||||
    margin: 0 50px 50px 50px;
 | 
					 | 
				
			||||||
    display: flex;
 | 
					    display: flex;
 | 
				
			||||||
    height: 100%;
 | 
					    flex-grow: 1;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.mainImage {
 | 
				
			||||||
 | 
					    margin: auto;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.mx_ImageView_content img {
 | 
					.mx_ImageView_content img {
 | 
				
			||||||
    object-fit: contain;
 | 
					    object-fit: contain;
 | 
				
			||||||
    pointer-events: all;
 | 
					    pointer-events: all;
 | 
				
			||||||
    //margin: auto;
 | 
					 | 
				
			||||||
    //margin: 0 auto 0 auto;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.mx_ImageView_panel {
 | 
					.mx_ImageView_panel {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -163,6 +163,10 @@ export default class ImageView extends React.Component {
 | 
				
			|||||||
        };
 | 
					        };
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
        let res;
 | 
					        let res;
 | 
				
			||||||
 | 
					        const style = {
 | 
				
			||||||
 | 
					            height: this.state.zoom + "%",
 | 
				
			||||||
 | 
					            width: this.state.zoom + "%",
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (this.props.width && this.props.height) {
 | 
					        if (this.props.width && this.props.height) {
 | 
				
			||||||
            res = this.props.width + "x" + this.props.height + "px";
 | 
					            res = this.props.width + "x" + this.props.height + "px";
 | 
				
			||||||
@@ -213,8 +217,7 @@ export default class ImageView extends React.Component {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const rotationDegrees = this.state.rotationDegrees;
 | 
					        const rotationDegrees = this.state.rotationDegrees;
 | 
				
			||||||
        const zoom = this.state.zoom/100;
 | 
					        const effectiveStyle = {transform: `rotate(${rotationDegrees}deg)`, ...style};
 | 
				
			||||||
        const effectiveStyle = {transform: `rotate(${rotationDegrees}deg) scale(${zoom})`};
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return (
 | 
					        return (
 | 
				
			||||||
            <FocusLock
 | 
					            <FocusLock
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user