Changeset 253
- Timestamp:
- 08/29/08 15:40:11 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
packages/defconAppKit/trunk/Lib/defconAppKit/representationFactories/__init__.py
r235 r253 3 3 from defconAppKit.representationFactories.glyphCellFactory import GlyphCellFactory 4 4 from defconAppKit.representationFactories.glyphCellDetailFactory import GlyphCellDetailFactory 5 from defconAppKit.representationFactories.glyphViewFactories import NoComponentsNSBezierPathFactory, OnlyComponentsNSBezierPathFactory, OutlineInformationFactory 6 7 _factories = { 8 "NSBezierPath" : NSBezierPathFactory, 9 "NoComponentsNSBezierPath" : NoComponentsNSBezierPathFactory, 10 "OnlyComponentsNSBezierPath" : OnlyComponentsNSBezierPathFactory, 11 "defconAppKitGlyphCell" : GlyphCellFactory, 12 "defconAppKitGlyphCellDetail" : GlyphCellDetailFactory, 13 "defconAppKitOutlineInformation" : OutlineInformationFactory 14 } 15 16 # used by the glyph multiline view 17 try: 18 from defconAppKit.representationFactories.t2CharStringFactory import T2CharStringRepresentationFactory 19 _factories["T2CharString"] = T2CharStringRepresentationFactory 20 except ImportError: 21 pass 5 22 6 23 7 24 def registerAllFactories(): 8 addRepresentationFactory("NSBezierPath", NSBezierPathFactory) 9 addRepresentationFactory("defconAppKitGlyphCell", GlyphCellFactory) 10 addRepresentationFactory("defconAppKitGlyphCellDetail", GlyphCellDetailFactory) 25 for name, factory in _factories.items(): 26 addRepresentationFactory(name, factory) packages/defconAppKit/trunk/Lib/defconAppKit/representationFactories/glyphCellFactory.py
r235 r253 47 47 headerRect = ((0, -self.height+self.headerHeight), (self.width, self.headerHeight)) 48 48 # background 49 context.saveGraphicsState() 50 transform = NSAffineTransform.transform() 51 transform.translateXBy_yBy_(0, self.height-self.headerHeight) 52 transform.scaleXBy_yBy_(1.0, -1.0) 53 transform.concat() 49 54 self.drawCellBackground(bodyRect) 55 context.restoreGraphicsState() 50 56 # glyph 51 57 if self.shouldDrawMetrics:
