File tree Expand file tree Collapse file tree
packages/media-editor/src/components/media-editor-canvas Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import type { CropperState } from '../../image-editor';
1616 * @param height Output crop height in source pixels.
1717 */
1818export function formatBadgeText ( width : number , height : number ) : string {
19- return `${ Math . round ( width ) } × ${ Math . round ( height ) } ` ;
19+ return `W: ${ Math . round ( width ) } px H: ${ Math . round ( height ) } px ` ;
2020}
2121
2222export interface CropDimensionsBadgeProps {
Original file line number Diff line number Diff line change 2222 top : $grid-unit-15 ;
2323 left : $grid-unit-15 ;
2424 padding : $grid-unit-05 $grid-unit-10 ;
25- border-radius : $radius-full ;
25+ border-radius : 0 ;
2626 background : #fff ;
2727 color : $gray-900 ;
2828 font-size : 11px ;
Original file line number Diff line number Diff line change 44import { formatBadgeText } from '../crop-dimensions-badge' ;
55
66describe ( 'formatBadgeText' , ( ) => {
7- it ( 'renders integer-rounded dimensions with a multiplication sign ' , ( ) => {
8- expect ( formatBadgeText ( 1240.4 , 819.6 ) ) . toBe ( '1240 × 820 ' ) ;
7+ it ( 'renders integer-rounded dimensions with px-suffixed labels ' , ( ) => {
8+ expect ( formatBadgeText ( 1240.4 , 819.6 ) ) . toBe ( 'W: 1240px H: 820px ' ) ;
99 } ) ;
1010
1111 it ( 'handles whole-pixel dimensions' , ( ) => {
12- expect ( formatBadgeText ( 500 , 333 ) ) . toBe ( '500 × 333 ' ) ;
12+ expect ( formatBadgeText ( 500 , 333 ) ) . toBe ( 'W: 500px H: 333px ' ) ;
1313 } ) ;
1414} ) ;
You can’t perform that action at this time.
0 commit comments