On Nov 9, 2013, at 11:08, Christiaan Hofman wrote:

> 
> On Nov 9, 2013, at 5:19, Adam R. Maxwell wrote:
> 
>> 
>> On Nov 8, 2013, at 06:00 , Christiaan Hofman <[email protected]> wrote:
>> 
>>> 1. Maybe PDFView has problems with zero-size notes, which is the initial 
>>> size in note tool mode.
>> 
>> This seems to be the problem. If I set a minimum size like so:
>> 
>> - (void)addAnnotationWithType:(SKNoteType)annotationType contents:(NSString 
>> *)text page:(PDFPage *)page bounds:(NSRect)bounds {
>>      PDFAnnotation *newAnnotation = nil;
>>     PDFSelection *sel = [self currentSelection];
>>     if (NSIsEmptyRect(bounds)) {
>>         bounds.size.height = MAX(bounds.size.height, 5);
>>         bounds.size.width = MAX(bounds.size.width, 5);
>>     }
>> 
>> the problem goes away. Note that a minimum size of 1 will still cause a 
>> hang, and initial resizing is a bit weird; if you drag it diagonally or 
>> horizontally, the circle only stretches vertically. After releasing the 
>> mouse and dragging again, diagonal resize works. Might be something with the 
>> mouse location; I didn't look too hard.
>> 
>> Adam
> 
> The latter problem is because the resizing takes a zero size as a sign that 
> this is just added by the tool mode and therefore adapts the drag handle to 
> the drag direction rather than having it fixed (in dragAnnotationWithEvent:). 
> So much more should be changed if the initial size is changed.
> 
> I wonder what really gets the problem: drawing the small note, or perhaps the 
> redisplay. What happens if you change in PDFView(SKExtensions) 
> setNeedsDisplayForAnnotation:onPage:, or perhaps 
> setNeedsDisplayInRect:ofPage: to handle small notes differently?
> 
> Christiaan
> 

And be careful, setNeedsDisplayForAnnotation:onPage: has an override in 
SKPDFView.

Christiaan

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
skim-app-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-develop

Reply via email to