+// Update the descent value when whe are in a <sub> or <sup>.
+// prevbase is the parent base
+void wxHtmlCell::SetScriptMode(wxHtmlScriptMode mode, long previousBase)
+{
+ m_ScriptMode = mode;
+
+ if (mode == wxHTML_SCRIPT_SUP)
+ m_ScriptBaseline = previousBase - (m_Height + 1) / 2;
+ else if (mode == wxHTML_SCRIPT_SUB)
+ m_ScriptBaseline = previousBase + (m_Height + 1) / 6;
+ else
+ m_ScriptBaseline = 0;
+
+ m_Descent += m_ScriptBaseline;
+}