Esempio n. 1
0
        private static void ResolveSourceLink(CGUIStyleTextMeasure measure, ref CStackTraceLine stackLine)
        {
            Color color = CEditorSkin.GetColor(stackLine.sourcePathExists ? CColorCode.Link : CColorCode.LinkInnactive);

            int sourceStart = stackLine.sourcePathStart;
            int sourceEnd   = stackLine.sourcePathEnd;

            GUIStyle   style   = measure.Style;
            GUIContent content = new GUIContent(stackLine.line);

            float startPosX = style.GetCursorPixelPosition(stackLine.frame, content, sourceStart).x - 1;
            float endPosX   = style.GetCursorPixelPosition(stackLine.frame, content, sourceEnd).x + 1;

            stackLine.sourceFrame = new Rect(startPosX, stackLine.frame.y, endPosX - startPosX, stackLine.frame.height);
            stackLine.line        = CStringUtils.C(stackLine.line, color, sourceStart, sourceEnd);
        }