void BoardDrawer::drawFlag(int row, int col) { m_ctx->clearRect(col * 10 + 1, row * 10 + 1, 8, 8); m_ctx->beginPath(); m_ctx->moveTo(col * 10 + 1, row * 10 + 1); m_ctx->lineTo(col * 10 + 9, row * 10 + 1); m_ctx->lineTo(col * 10 + 1, row * 10 + 9); m_ctx->closePath(); m_ctx->fill(); }
JSValue* jsCanvasRenderingContext2DPrototypeFunctionBeginPath(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args) { if (!thisValue->isObject(&JSCanvasRenderingContext2D::s_info)) return throwError(exec, TypeError); JSCanvasRenderingContext2D* castedThisObj = static_cast<JSCanvasRenderingContext2D*>(thisValue); CanvasRenderingContext2D* imp = static_cast<CanvasRenderingContext2D*>(castedThisObj->impl()); imp->beginPath(); return jsUndefined(); }
void BoardDrawer::drawMine(int row, int col) { m_ctx->clearRect(col * 10, row * 10, 10, 10); m_ctx->beginPath(); m_ctx->arc(col * 10 + 5, row * 10 + 5, 4.5, 0, 2 * M_PI); m_ctx->stroke(); }