Nicolas Cellier uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-nice.250.mcz ==================== Summary ==================== Name: Graphics-nice.250 Author: nice Time: 5 October 2013, 12:51:56.389 am UUID: 792cd68c-1112-4b21-81aa-a263b503fd23 Ancestors: Graphics-nice.249 Categorize placeEmbeddedObject: as private Merge Graphics-Text support and Graphics-Text: really, these are all support classes Remove TextLine>>justifiedPadFor: which is superseded by justifiedPadFor:font: for a few years now (since integration of FreeType support in trunk image). =============== Diff against Graphics-nice.249 =============== Item was changed: SystemOrganization addCategory: #'Graphics-Display Objects'! SystemOrganization addCategory: #'Graphics-External-Ffenestri'! SystemOrganization addCategory: #'Graphics-Files'! SystemOrganization addCategory: #'Graphics-Fonts'! SystemOrganization addCategory: #'Graphics-Primitives'! SystemOrganization addCategory: #'Graphics-Text'! SystemOrganization addCategory: #'Graphics-Transformations'! - SystemOrganization addCategory: #'Graphics-Text Support'! Item was changed: + ----- Method: CharacterBlockScanner>>placeEmbeddedObject: (in category 'private') ----- - ----- Method: CharacterBlockScanner>>placeEmbeddedObject: (in category 'stop conditions') ----- placeEmbeddedObject: anchoredMorph "Workaround: The following should really use #textAnchorType" anchoredMorph relativeTextAnchorPosition ifNotNil:[^true]. (super placeEmbeddedObject: anchoredMorph) ifFalse: [^ false]. specialWidth := anchoredMorph width. ^ true! Item was changed: + ----- Method: CharacterScanner>>placeEmbeddedObject: (in category 'private') ----- - ----- Method: CharacterScanner>>placeEmbeddedObject: (in category 'text attributes') ----- placeEmbeddedObject: anchoredMorph "Place the anchoredMorph or return false if it cannot be placed. In any event, advance destX by its width." | w | "Workaround: The following should really use #textAnchorType" anchoredMorph relativeTextAnchorPosition ifNotNil:[^true]. destX := destX + (w := anchoredMorph width). (destX > rightMargin and: [(leftMargin + w) <= rightMargin]) ifTrue: ["Won't fit, but would on next line" ^ false]. lastIndex := lastIndex + 1. "self setFont." "Force recalculation of emphasis for next run" ^ true! Item was changed: + ----- Method: CompositionScanner>>placeEmbeddedObject: (in category 'private') ----- - ----- Method: CompositionScanner>>placeEmbeddedObject: (in category 'stop conditions') ----- placeEmbeddedObject: anchoredMorph | descent | "Workaround: The following should really use #textAnchorType" anchoredMorph relativeTextAnchorPosition ifNotNil:[^true]. (super placeEmbeddedObject: anchoredMorph) ifFalse: ["It doesn't fit" "But if it's the first character then leave it here" lastIndex < line first ifFalse:[ line stop: lastIndex-1. ^ false]]. descent := lineHeight - baseline. lineHeight := lineHeight max: anchoredMorph height. baseline := lineHeight - descent. line stop: lastIndex. ^ true! Item was changed: + ----- Method: DisplayScanner>>placeEmbeddedObject: (in category 'private') ----- - ----- Method: DisplayScanner>>placeEmbeddedObject: (in category 'stop conditions') ----- placeEmbeddedObject: anchoredMorph anchoredMorph relativeTextAnchorPosition ifNotNil:[ anchoredMorph position: anchoredMorph relativeTextAnchorPosition + (anchoredMorph owner textBounds origin x @ 0) - (0@morphicOffset y) + (0@lineY). ^true ]. (super placeEmbeddedObject: anchoredMorph) ifFalse: [^ false]. (anchoredMorph isMorph or: [anchoredMorph isPrimitiveCostume]) ifTrue: [ anchoredMorph position: ((destX - anchoredMorph width)@lineY) - morphicOffset ] ifFalse: [ destY := lineY. runX := destX. anchoredMorph displayOn: bitBlt destForm at: destX - anchoredMorph width @ destY clippingBox: bitBlt clipRect ]. ^ true! Item was changed: Object subclass: #TextComposer instanceVariableNames: 'lines maxRightX currentY scanner possibleSlide nowSliding prevIndex prevLines currCharIndex startCharIndex stopCharIndex deltaCharIndex theText theContainer isFirstLine theTextStyle defaultLineHeight actualHeight wantsColumnBreaks' classVariableNames: '' poolDictionaries: '' + category: 'Graphics-Text'! - category: 'Graphics-Text Support'! Item was changed: Object subclass: #TextLine instanceVariableNames: 'left right top bottom firstIndex lastIndex internalSpaces paddingWidth baseline leftMargin' classVariableNames: '' poolDictionaries: 'TextConstants' + category: 'Graphics-Text'! - category: 'Graphics-Text Support'! !TextLine commentStamp: '<historical>' prior: 0! A TextLine embodies the layout of a line of composed text. left right top bottom The full line rectangle firstIndex lastIndex Starting and stopping indices in the full text internalSpaces Number of spaces to share paddingWidth paddingWidth Number of pixels of extra space in full line baseline Distance of baseline below the top of the line leftMargin Left margin due to paragraph indentation TextLine's rather verbose message protocol is required for compatibility with the old CharacterScanners.! Item was removed: - ----- Method: TextLine>>justifiedPadFor: (in category 'scanning') ----- - justifiedPadFor: spaceIndex - "Compute the width of pad for a given space in a line of justified text." - - | pad | - internalSpaces = 0 ifTrue: [^0]. - pad := paddingWidth // internalSpaces. - spaceIndex <= (paddingWidth \\ internalSpaces) - ifTrue: [^pad + 1] - ifFalse: [^pad]! |
Free forum by Nabble | Edit this page |