#244 wxScintilla requires "ascent" to be public

Feature_Request
closed-fixed
Scintilla (796)
2
2005-02-02
2004-11-18
Otto Wyss
No

In Platform.h there is an "int ascent" but protected.
Since ascent is accessed outside it has to be public.
wxStyledTextCtrl doesn't have this restriction but that's
most probably a bug there. Anyway this change should
not have any negative effects.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2004-11-21
    • assigned_to: nobody --> nyamatongwe
    • milestone: 100660 --> Feature_Request
    • priority: 5 --> 2
    • status: open --> open-rejected
     
  • Neil Hodgson

    Neil Hodgson - 2004-11-21

    Logged In: YES
    user_id=12579

    Surface::Ascent

     
  • Otto Wyss

    Otto Wyss - 2004-11-21

    Logged In: YES
    user_id=400476

    Excuse me, I don't understand the comment "Surface::Ascent".
    Could it be more explained?

     
  • Neil Hodgson

    Neil Hodgson - 2004-11-23

    Logged In: YES
    user_id=12579

    Call the Surface::Ascent method with the font.

     
  • Otto Wyss

    Otto Wyss - 2004-12-06

    Logged In: YES
    user_id=400476

    Okay the alternate is to add a "friend class SurfaceImpl" to
    the font.

    Index: include/Platform.h

    =====================
    RCS file: /cvsroot/scintilla/scintilla/include/Platform.h,v
    retrieving revision 1.52
    diff -r1.52 Platform.h
    289a290
    > friend class SurfaceImpl;

     
  • Otto Wyss

    Otto Wyss - 2004-12-06
    • status: open-rejected --> open
     
  • Neil Hodgson

    Neil Hodgson - 2005-02-02

    Logged In: YES
    user_id=12579

    How is this better than calling Surface::Ascent?

     
  • Robin Dunn

    Robin Dunn - 2005-02-02

    Logged In: YES
    user_id=53955

    In PlatWX SurfaceImpl::Ascent sets the font.ascent so it
    doesn't have to be recalculated/remeasured every time it is
    used (which is every DrawText call.) So it either needs to
    have friend access to be able to set the ascent value or
    there needs to be a setter method in Font.

     
  • Robin Dunn

    Robin Dunn - 2005-02-02

    Logged In: YES
    user_id=53955

    BTW, I usually just add "friend class SurfaceImpl;" to the
    wx copy of Platform.h.

     
  • Neil Hodgson

    Neil Hodgson - 2005-02-02
    • status: open --> closed-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2005-02-02

    Logged In: YES
    user_id=12579

    OK, I'll add in the friend declaration. Storing the ascent
    is really just an optimization that other modules shouldn't see.
    For GTK+, there is a FontHandle implementation class for the
    platform font pointers and additional optimization
    information including ascent. This hides the implementation
    details from the code that uses Platform.h.

     

Log in to post a comment.