void InspectorHighlight::appendQuad(const FloatQuad& quad, const Color& fillColor, const Color& outlineColor, const String& name) { Path path = quadToPath(quad); PathBuilder builder; builder.appendPath(path); appendPath(builder.path(), fillColor, outlineColor, name); }
static void drawOutlinedQuad(GraphicsContext* context, const FloatQuad& quad, const Color& fillColor, const Color& outlineColor) { static const int outlineThickness = 2; Path quadPath = quadToPath(quad); // Clip out the quad, then draw with a 2px stroke to get a pixel // of outline (because inflating a quad is hard) { context->save(); context->clipOut(quadPath); context->setStrokeThickness(outlineThickness); context->setStrokeColor(outlineColor, ColorSpaceDeviceRGB); context->strokePath(quadPath); context->restore(); } // Now do the fill context->setFillColor(fillColor, ColorSpaceDeviceRGB); context->fillPath(quadPath); }