NSBezierPath is a class responsible for constructing and drawing paths in Cocoa.
Questions tagged [nsbezierpath]
150 questions
0
votes
1 answer
SWIFT OSX NSBezierPath Linewidth property not working
I am using the following code to draw a line graph on a custom NSView
for var index = 0; index < (dataPointsArray.count - 1); index++ {
NSBezierPath().lineWidth = 20.0
NSBezierPath.strokeLineFromPoint(dataPointsArray[index], toPoint:…

Wolfstar
- 111
- 10
0
votes
0 answers
Clearing drawings from an NSView object
I have a subclassed NSView drawing column graphs in a portion of another NSView object.
The drawRect() function below draws the columns based on passed parameters correctly.
However, when I adjust the parameters and update the view (through…

Wolfstar
- 111
- 10
0
votes
2 answers
Cocoa editing NSBezierPath
I have a simple bezierPath with 2 elements in a NSView;
I want to modify the last element (NSPoint) on a button pressed but my code don't have any visual effect on the path.
Here my code in NSView subclass:
NSBezierPath *path;
-…

mattiad
- 13
- 1
- 6
0
votes
1 answer
NSBezierPath added unwanted inverted rectangle
I have a custom NSView linked up with a custom view in my xib.
code from the view:
@implementation GDStatusPopoverActivateButton
- (void)drawRect:(NSRect)dirtyRect {
NSBezierPath* path = [GDAssets getPathForTimesIconWithRect: self.bounds];
…

yansun0
- 83
- 1
- 1
- 4
0
votes
1 answer
Matt Gemmell's NSBezierPath+StrokeExtensions draws outside of clip rect
I'm using Matt Gemmell's NSBezierPath+StrokeExtensions category to draw an inside stroke on an NSRect. Here is the code for the entire category:
- (void)strokeInside
{
/* Stroke within path using no additional clipping rectangle. */
[self…

danjonweb
- 456
- 3
- 14
0
votes
1 answer
Possibility to setTooltip on NSBezierPath
I'm wondering if it's possible to set a tooltip on a drawn NSBezierPath.
Why I'm asking this is the following: I'm adding shapes in the form of NSRect to the view. These rects represent periods of history. It would be amazing to see the start year…

Verbe
- 634
- 7
- 13
0
votes
1 answer
When defining a cubic bezier curve, is there a way to test if there is ever a value of X that contains more than one value for Y?
We're trying to create a curve editor program for calibrating hardware. As such, Bezier curves seem to be the easiest UI for a person to work with. However, the problem with bezier curves is it's possible to create a curve where there is more than…

Mark A. Donohoe
- 28,442
- 25
- 137
- 286
0
votes
1 answer
NSBezierPath appendBezierPathWithArcFromPoint Wont Draw
I am attempting to draw and arc using "appendBezierPathWithArcFromPoint" but when run, it doesn't draw the arc. The "lineToPont" works and other "NSBezierPath" commands work. Can anyone please help by telling me what I am doing wrong. I have done…

Adrian
- 1
- 1
0
votes
0 answers
appendBezierPath with style of second path
I have 2 bezierPath. On a first path I draw grid. I handle mouse event and draw new path on first path. I use appendBezierPath, that's all ok, but style of second path don't copy. Cocoa use first path style. How can I append new bezier path with new…

Lee Twelve
- 65
- 8
0
votes
1 answer
NSBezierPath Object Appears to Be Drawing Variable Line Width
Ok, so I'm trying to draw a dashed box that's subdivided into sections where I'm going to put content. Here's my code:
NSBezierPath *path = [NSBezierPath bezierPathWithRect:dirtyRect];
[path setLineWidth:3];
CGFloat pattern[2] = {5, 5};
[path…

Chris Fretz
- 387
- 1
- 2
- 10
0
votes
1 answer
Repainting NSBezierPath
This is the way I'm painting a like-popover window with a bezier path. The BOOLEAN bAbajo makes the drawing window point upwards. If not bAbajo, it points upwards:
- (void)drawRect:(NSRect)dirtyRect
{
NSRect contentRect = NSInsetRect([self…

Laureano Bonilla
- 335
- 3
- 18
0
votes
2 answers
NSBezierPath containsPoint: is too sensitive when path not closed
I have a problem with the containsPoint method. I draw some boxes and connectors between the boxes. The connectors are basicly a single curve, based on a single curveToPoint:controlPoint1:controlPoint2 call. When I now try to select this curve/path…

Wizard of Kneup
- 1,863
- 1
- 18
- 35
0
votes
2 answers
Is it possible to fill NSRect with a particular pattern using NSBezierPath?
I'm curious if I can draw a NSRect using NSBezierPath and then fill it with some striped pattern so it looks something like the picture below?
Any kind of help is highly appreciated!

Eugene Gordin
- 4,047
- 3
- 47
- 80
0
votes
0 answers
objective-c - how to reverse a triangle cutout - OSX
I need some help reversing a triangle cutout.
I can make the rectangle with a triangle cutout on it's right:
using these coordinates:
NSInteger imageWidth=12, imageHeight=22;
NSImage* destImage = [[NSImage alloc]…

ICL1901
- 7,632
- 14
- 90
- 138
0
votes
1 answer
Click on NSBezierPath
I'm drawing a NSBezierPath line on my NSImageView. I'm creating NSBezierPath object, setting moveToPoint, setting lineToPoint, setting setLineWidth: and after that in drawRect of my NSImageView subclass I'm calling [myNSBezierPath stroke]. It all…

jovanjovanovic
- 4,158
- 3
- 22
- 32