osx - NSView -drawRect and mouse hover performance -


I have a custom NSV that pulls a graph (with -drawRect ). It also tracks the position of the mouse (with -mousemoved and so on) and the cursor draws coordinates relative to position / latitude.

The graph is large and (potentially) slow is drawn, and the mouse does not depend on the situation. The mouse-over effect is small, and is always fast to attract. I do not have to overturn anything when the mouse runs a few pixels, because it looks sluggish.

I'm sure I can double my own personal graphics reference (size, if a 2x display), draw that chart data at a time, and then click - Draw Alternatively, I can divide my NSView subclass into two classes, and only have a chart data and a bus overlay, and keep them at the top of each other ( Though they Do not share a small portion of the data, so it seems odd).

Is there a built-in method to make it easy, or is there another idiotic way to handle it? Take a look at these NSWindow methods:

Take a look at these NSWindow methods:

Bracketting drawing operation ?? ?? Cacheimageignate: a ???? Restore image image DiscardCachedImage

Generally, with a view, you define a drawRect: method that pulls content on demand. However, for example, by locking the focus of the event, performing the drawing, unlocking the focus, for example, you can do spot drawings on the outcome of the events. The missing link in the on-the-spot drawing, is being removed in any way without attracting you to your potentially huge potential. Set: Through Needs Display:

This is where the Bracket drawing on NSWindow comes in the operation game. Before locking the focus on the scene and making some drawings, cache the image of the scene in the area that you want to attract when you want to update your drawing (possibly tracking events), then restoring the cached image. Do, Rinse, and Repeat

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -