Changeset 34161 in webkit
- Timestamp:
- May 27, 2008 7:45:01 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r34158 r34161 1 2008-05-27 Timothy Hatcher <timothy@apple.com> 2 3 Fixes a regression where the Image and Font preview views do not 4 size correctly. 5 6 <rdar://problem/5966723> REGRESSION (r33991): Image and font previews 7 are shrunken and can't be made larger (19281) 8 9 Reviewed by Adam Roben. 10 11 * page/inspector/FontView.js: Adjust the font size based only on the 12 container width minus padding. 13 * page/inspector/inspector.css: Updated styles for the image and 14 font views. 15 1 16 2008-05-27 Adam Roben <aroben@apple.com> 2 17 -
trunk/WebCore/page/inspector/FontView.js
r33403 r34161 72 72 var width = this.fontPreviewElement.offsetWidth; 73 73 74 var containerHeight = this.contentElement.offsetHeight;75 74 var containerWidth = this.contentElement.offsetWidth; 76 75 77 if (!height || !width || !containerHeight || !containerWidth) { 76 // Subtract some padding. This should match the padding in the CSS plus room for the scrollbar. 77 containerWidth -= 40; 78 79 if (!height || !width || !containerWidth) { 78 80 this.fontPreviewElement.style.removeProperty("font-size"); 79 81 this.fontPreviewElement.style.removeProperty("position"); … … 86 88 var fontSizeLineRatio = measureFontSize / realLineHeight; 87 89 var widthRatio = containerWidth / width; 88 var heightRatio = containerHeight / height; 89 90 if (heightRatio < widthRatio) 91 var finalFontSize = Math.floor(realLineHeight * heightRatio * fontSizeLineRatio) - 1; 92 else 93 var finalFontSize = Math.floor(realLineHeight * widthRatio * fontSizeLineRatio) - 1; 90 var finalFontSize = Math.floor(realLineHeight * widthRatio * fontSizeLineRatio) - 1; 94 91 95 92 this.fontPreviewElement.style.setProperty("font-size", finalFontSize + "px", null); -
trunk/WebCore/page/inspector/inspector.css
r34096 r34161 650 650 } 651 651 652 .resource-view.font {652 .resource-view.font .resource-view-content { 653 653 font-size: 60px; 654 654 white-space: pre-wrap; 655 655 word-wrap: break-word; 656 656 text-align: center; 657 } 658 659 .resource-view.font .preview { 660 position: absolute; 661 margin-top: auto; 662 margin-bottom: auto; 663 top: 0; 664 left: 0; 665 right: 0; 666 bottom: 0; 657 padding: 15px; 667 658 } 668 659 669 660 .resource-view.image .resource-view-content > .image { 670 position: relative; 671 height: 70%; 672 padding: 20px; 661 padding: 20px 20px 10px 20px; 662 text-align: center; 673 663 } 674 664 675 665 .resource-view.image .resource-view-content > .info { 676 position: relative; 677 height: 30%; 678 padding-top: 10px; 679 overflow: auto; 666 padding-bottom: 10px; 680 667 font-size: 11px; 668 -webkit-user-select: text; 681 669 } 682 670 683 671 .resource-view.image img { 684 margin: auto; 685 position: absolute; 686 top: 0; 687 left: 0; 688 right: 0; 689 bottom: 0; 690 max-width: 80%; 691 max-height: 80%; 672 max-width: 100%; 673 max-height: 1000px; 692 674 background-image: url(Images/checker.png); 693 675 -webkit-box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.5); 676 -webkit-user-select: text; 677 -webkit-user-drag: auto; 694 678 } 695 679 … … 708 692 width: 50%; 709 693 text-align: right; 694 color: rgb(76, 76, 76); 710 695 } 711 696 712 697 .resource-view.image .infoList dd { 713 698 display: inline-block; 714 padding-left: 10px;699 padding-left: 8px; 715 700 width: 50%; 716 701 text-align: left;
Note: See TracChangeset
for help on using the changeset viewer.