0
class VisualizationView < OSX::NSView
0
ib_outlet :application_controller
0
@@ -26,20 +28,49 @@ class VisualizationView < OSX::NSView
0
context = NSGraphicsContext.currentContext
0
NSColor.darkGrayColor.set
0
- NSRectFill(self.bounds)
0
path = NSBezierPath.bezierPath
0
- path.moveToPoint([100, 100])
0
- @repo.commits(:master, 50, 0).each_with_index do |commit, index|
0
- point = NSMakePoint(((index + 1) * 25), 100)
0
- path.lineToPoint([25 * index, 100])
0
- path.appendBezierPathWithOvalInRect(NSMakeRect(point[0] - 10, point[1], 10, 10))
0
+ path.moveToPoint([100, 105])
0
+ path.appendBezierPathWithOvalInRect(NSMakeRect(100, 100, 10, 10))
0
+ path.relativeMoveToPoint([0, 3.5])
0
+ context.saveGraphicsState
0
+ path.relativeLineToPoint([90, 0])
0
+ context.restoreGraphicsState
0
+ path.relativeMoveToPoint([5, 5])
0
+ path.relativeCurveToPoint_controlPoint1_controlPoint2([40, 20], [0, 20], [-5, 20])
0
+ path.appendBezierPathWithOvalInRect(NSMakeRect(200, 100, 10, 10))
0
+ path.relativeMoveToPoint([0, 3.5])
0
+ path.relativeLineToPoint([90, 0])
0
+ path.appendBezierPathWithOvalInRect(NSMakeRect(300, 100, 10, 10))
0
+ # commits = @repo.git.rev_list({:topo_order => true, :all => true, :pretty => 'raw', :full_history => true})
0
+ # commits = Grit::Commit.list_from_string(@repo, commits)
0
+ # commits.each_with_index do |commit, index|
0
+ # current_offset = 25 * (index + path_offset)
0
+ # path.moveToPoint([current_offset - ((path_offset * 25) + 40), 105])
0
+ # path.lineToPoint([current_offset, 105])
0
+ # path.appendBezierPathWithOvalInRect(NSMakeRect(current_offset, 100, 10, 10))
0
+ # commit.parents.each do |parent|
0
+ # npath = NSBezierPath.bezierPathWithOvalInRect(NSMakeRect((current_offset + 25), 125, 10, 10))
0
+ # NSColor.blueColor.set
0
+ # NSColor.whiteColor.set
0
+ # end if commit.parents.size > 1
Comments
No one has commented yet.